Method: JSONMapper::ClassMethods#json_attribute
- Defined in:
- lib/json_mapper.rb
#json_attribute(name, *args) ⇒ Object
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/json_mapper.rb', line 33 def json_attribute(name, *args) source_attributes, type, = extract_attribute_data(name, *args) attribute = Attribute.new(name, source_attributes, type, ) @attributes[to_s] ||= [] @attributes[to_s] << attribute attr_accessor attribute.method_name.to_sym end |