Module: GOBL::Extensions::Schema::ObjectHelper::ClassMethods
- Included in:
- Schema::Object
- Defined in:
- lib/gobl/extensions/schema/object_helper.rb
Instance Method Summary collapse
-
#embed(struct) ⇒ Object
Embeds the given GOBL struct in a new object injecting the proper Schema ID.
Instance Method Details
#embed(struct) ⇒ Object
Embeds the given GOBL struct in a new object injecting the proper Schema ID.
40 41 42 43 44 |
# File 'lib/gobl/extensions/schema/object_helper.rb', line 40 def (struct) new struct.as_json.merge( '$schema' => struct.class::SCHEMA_ID ) end |