Class: Content::Item
- Inherits:
-
Object
- Object
- Content::Item
- Defined in:
- lib/myer/content.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#tag ⇒ Object
Returns the value of attribute tag.
-
#written_at ⇒ Object
Returns the value of attribute written_at.
Instance Method Summary collapse
- #data ⇒ Object
- #data=(value) ⇒ Object
-
#initialize(container) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(container) ⇒ Item
Returns a new instance of Item.
5 6 7 |
# File 'lib/myer/content.rb', line 5 def initialize(container) @container = container end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/myer/content.rb', line 3 def id @id end |
#tag ⇒ Object
Returns the value of attribute tag.
3 4 5 |
# File 'lib/myer/content.rb', line 3 def tag @tag end |
#written_at ⇒ Object
Returns the value of attribute written_at.
3 4 5 |
# File 'lib/myer/content.rb', line 3 def written_at @written_at end |
Instance Method Details
#data ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/myer/content.rb', line 13 def data if @container.type == "json" JSON.parse(@data) else @data end end |
#data=(value) ⇒ Object
9 10 11 |
# File 'lib/myer/content.rb', line 9 def data=(value) @data = value end |