Class: Kentico::Kontent::Delivery::TaxonomyGroup
- Inherits:
-
Object
- Object
- Kentico::Kontent::Delivery::TaxonomyGroup
- Defined in:
- lib/delivery/models/taxonomy_group.rb
Instance Method Summary collapse
-
#initialize(source) ⇒ TaxonomyGroup
constructor
Constructor.
-
#system ⇒ Object
Parses the ‘system’ JSON node as a dynamic OpenStruct object.
-
#terms ⇒ Object
Parses the ‘terms’ JSON node as a dynamic OpenStruct object.
Constructor Details
#initialize(source) ⇒ TaxonomyGroup
Constructor.
-
Args:
-
json (
JSON
) A JSON node representing a taxonomy group
-
33 34 35 |
# File 'lib/delivery/models/taxonomy_group.rb', line 33 def initialize(source) @source = source end |
Instance Method Details
#system ⇒ Object
Parses the ‘system’ JSON node as a dynamic OpenStruct object.
-
Returns:
-
OpenStruct
The system properties of the taxonomy group
-
21 22 23 24 25 26 27 |
# File 'lib/delivery/models/taxonomy_group.rb', line 21 def system @system unless @system.nil? @system = JSON.parse( JSON.generate(@source['system']), object_class: OpenStruct ) end |
#terms ⇒ Object
Parses the ‘terms’ JSON node as a dynamic OpenStruct object.
-
Returns:
-
OpenStruct
The terms of the taxonomy group as a dynamic object
-
9 10 11 12 13 14 15 |
# File 'lib/delivery/models/taxonomy_group.rb', line 9 def terms @terms unless @terms.nil? @terms = JSON.parse( JSON.generate(@source['terms']), object_class: OpenStruct ) end |