# File lib/enumerated_attribute/method_definition_dsl.rb, line 77 def label(hash) raise(InvalidDefinition, "label or labels keyword should be followed by a hash of :enum_value=>'label'", caller) unless hash.is_a?(Hash) hash.each do |k,v| raise(InvalidDefinition, "#{k} is not an enumeration value for :#{@attr_name} attribute", caller) unless (k.is_a?(Symbol) && @attr_descriptor.include?(k)) raise(InvalidDefinition, "#{v} is not a string. Labels should be strings", caller) unless v.is_a?(String) @attr_descriptor.set_label(k, v) end end