Class: Sheety::Feed

Inherits:
Object
  • Object
show all
Includes:
Children
Defined in:
lib/sheety/feed.rb

Direct Known Subclasses

Cell, Row, Spreadsheet, Worksheet

Constant Summary collapse

'self'
'edit'
'alternate'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Children

#_get_i_val, #_passes_constraint, included

Constructor Details

#initialize(parent, entry = nil) ⇒ Feed

Returns a new instance of Feed.



14
15
16
17
18
19
20
# File 'lib/sheety/feed.rb', line 14

def initialize(parent, entry=nil)
  @parent = parent
  @links = {}
  unless entry.nil?
    parse(entry)
  end
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



10
11
12
# File 'lib/sheety/feed.rb', line 10

def content
  @content
end

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/sheety/feed.rb', line 10

def id
  @id
end

#parentObject (readonly)

Returns the value of attribute parent.



10
11
12
# File 'lib/sheety/feed.rb', line 10

def parent
  @parent
end

#titleObject

Returns the value of attribute title.



12
13
14
# File 'lib/sheety/feed.rb', line 12

def title
  @title
end

#updatedObject (readonly)

Returns the value of attribute updated.



10
11
12
# File 'lib/sheety/feed.rb', line 10

def updated
  @updated
end

Instance Method Details

#as_xmlObject



36
37
38
# File 'lib/sheety/feed.rb', line 36

def as_xml
  return "<entry></entry>"
end


32
33
34
# File 'lib/sheety/feed.rb', line 32

def link(key)
  @links[key]
end

#parse(entry) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/sheety/feed.rb', line 22

def parse(entry)
  return if entry.blank? || entry.length == 0
  @title = Sheety::Feed.deref(entry, 'title', 0, 'content')
  @id = Sheety::Feed.deref(entry, 'id', 0)
  @content = Sheety::Feed.deref(entry, 'content', 'content')
  @updated = Sheety::Feed.deref(entry, 'updated', 0)
  @updated = DateTime.iso8601(@updated) if !@updated.blank?
  add_links(Sheety::Feed.deref(entry ,'link'))
end