Class: Content::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/myer/content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/myer/content.rb', line 3

def id
  @id
end

#tagObject

Returns the value of attribute tag.



3
4
5
# File 'lib/myer/content.rb', line 3

def tag
  @tag
end

#written_atObject

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

#dataObject



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