Class: Gammo::Attribute
- Inherits:
-
Object
- Object
- Gammo::Attribute
- Defined in:
- lib/gammo/attribute.rb
Overview
Class for representing an attribute.
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key:, value:, namespace: nil, owner_element: nil) ⇒ Attribute
constructor
Constructs an attribute with the key-value pair.
- #to_s ⇒ Object
Constructor Details
#initialize(key:, value:, namespace: nil, owner_element: nil) ⇒ Attribute
Constructs an attribute with the key-value pair.
15 16 17 18 19 20 |
# File 'lib/gammo/attribute.rb', line 15 def initialize(key:, value:, namespace: nil, owner_element: nil) @key = key @value = value @namespace = namespace @owner_element = owner_element end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
4 5 6 |
# File 'lib/gammo/attribute.rb', line 4 def key @key end |
#namespace ⇒ Object
Returns the value of attribute namespace.
4 5 6 |
# File 'lib/gammo/attribute.rb', line 4 def namespace @namespace end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/gammo/attribute.rb', line 4 def value @value end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/gammo/attribute.rb', line 22 def to_s "<Gammo::Attribute #{key}='#{value}'>" end |