Module: JSON::Schematized::BasicWrapper::SchematizedArray
- Defined in:
- lib/json/schematized/basic_wrapper.rb
Instance Attribute Summary collapse
-
#members_module ⇒ Object
Returns the value of attribute members_module.
-
#members_type ⇒ Object
Returns the value of attribute members_type.
Instance Method Summary collapse
Instance Attribute Details
#members_module ⇒ Object
Returns the value of attribute members_module.
99 100 101 |
# File 'lib/json/schematized/basic_wrapper.rb', line 99 def members_module @members_module end |
#members_type ⇒ Object
Returns the value of attribute members_type.
98 99 100 |
# File 'lib/json/schematized/basic_wrapper.rb', line 98 def members_type @members_type end |
Instance Method Details
#<<(value) ⇒ Object
103 104 105 106 107 108 109 110 111 112 |
# File 'lib/json/schematized/basic_wrapper.rb', line 103 def <<(value) if members_module.json_schema[:type] == "object" new_value = members_type.new new_value.extend members_module new_value.attributes = value if value.is_a?(Hash) super(new_value) else super end end |
#coerce_members_to(*args) ⇒ Object
101 |
# File 'lib/json/schematized/basic_wrapper.rb', line 101 def coerce_members_to(*args); end |
#mass_assign!(array) ⇒ Object
114 115 116 117 118 |
# File 'lib/json/schematized/basic_wrapper.rb', line 114 def mass_assign!(array) array.each do |value| self << value end end |