Class: Set
- Inherits:
-
Object
- Object
- Set
- Includes:
- FIRM::Serializable::JSON::ContainerPatch
- Defined in:
- lib/firm/serializer/json.rb
Class Method Summary collapse
-
.json_create(object) ⇒ Set
Create a new Set instance from deserialized JSON data.
Instance Method Summary collapse
Methods included from FIRM::Serializable::JSON::ContainerPatch
Class Method Details
.json_create(object) ⇒ Set
Create a new Set instance from deserialized JSON data.
387 388 389 |
# File 'lib/firm/serializer/json.rb', line 387 def json_create(object) json_new(object) { |instance| instance.replace(object['a']) } end |
Instance Method Details
#as_json ⇒ Object
392 393 394 395 396 |
# File 'lib/firm/serializer/json.rb', line 392 def as_json(*) build_json do |json_data| json_data['a'] = to_a.collect { |e| e.respond_to?(:as_json) ? e.as_json : e } end end |