Class: Chiketto::Attribute
- Inherits:
-
Object
- Object
- Chiketto::Attribute
- Defined in:
- lib/chiketto/attribute.rb
Instance Attribute Summary collapse
-
#html ⇒ Object
Returns the value of attribute html.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ Attribute
constructor
A new instance of Attribute.
- #to_s ⇒ Object
Constructor Details
#initialize(hash = {}) ⇒ Attribute
Returns a new instance of Attribute.
5 6 7 8 9 |
# File 'lib/chiketto/attribute.rb', line 5 def initialize(hash = {}) hash ||= {} @text = hash.fetch('text') { '' } @html = hash.fetch('html') { @text } end |
Instance Attribute Details
#html ⇒ Object
Returns the value of attribute html.
3 4 5 |
# File 'lib/chiketto/attribute.rb', line 3 def html @html end |
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/chiketto/attribute.rb', line 3 def text @text end |
Instance Method Details
#to_s ⇒ Object
11 12 13 |
# File 'lib/chiketto/attribute.rb', line 11 def to_s text end |