Class: Kentico::Kontent::Delivery::TaxonomyGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/delivery/models/taxonomy_group.rb

Instance Method Summary collapse

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

#systemObject

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

#termsObject

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