Class: Bridgetown::Resource::TaxonomyTerm
- Inherits:
-
Object
- Object
- Bridgetown::Resource::TaxonomyTerm
- Defined in:
- lib/bridgetown-core/resource/taxonomy_term.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(resource:, label:, type:) ⇒ TaxonomyTerm
constructor
A new instance of TaxonomyTerm.
- #to_json ⇒ Object
- #to_liquid ⇒ Object (also: #to_h)
Constructor Details
#initialize(resource:, label:, type:) ⇒ TaxonomyTerm
Returns a new instance of TaxonomyTerm.
8 9 10 11 12 |
# File 'lib/bridgetown-core/resource/taxonomy_term.rb', line 8 def initialize(resource:, label:, type:) @resource = resource @label = label @type = type end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
6 7 8 |
# File 'lib/bridgetown-core/resource/taxonomy_term.rb', line 6 def label @label end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
6 7 8 |
# File 'lib/bridgetown-core/resource/taxonomy_term.rb', line 6 def resource @resource end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/bridgetown-core/resource/taxonomy_term.rb', line 6 def type @type end |
Instance Method Details
#as_json ⇒ Object
21 22 23 |
# File 'lib/bridgetown-core/resource/taxonomy_term.rb', line 21 def as_json(*) to_h end |
#to_json ⇒ Object
25 26 27 |
# File 'lib/bridgetown-core/resource/taxonomy_term.rb', line 25 def to_json(...) as_json(...).to_json(...) end |
#to_liquid ⇒ Object Also known as: to_h
14 15 16 17 18 |
# File 'lib/bridgetown-core/resource/taxonomy_term.rb', line 14 def to_liquid { "label" => label, } end |