Module: Card::Set::All::Rss::RssFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod006-basic_formats/all/rss.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#xmlObject

Returns the value of attribute xml.



9
10
11
# File 'tmpsets/set/mod006-basic_formats/all/rss.rb', line 9

def xml
  @xml
end

Instance Method Details

#initialize(card, args) ⇒ Object



11
12
13
14
# File 'tmpsets/set/mod006-basic_formats/all/rss.rb', line 11

def initialize card, args
  super
  @xml = @parent ? @parent.xml : ::Builder::XmlMarkup.new
end

#pub_dateObject



65
66
67
68
69
# File 'tmpsets/set/mod006-basic_formats/all/rss.rb', line 65

def pub_date
  (card.updated_at || Time.zone.now).to_s(:rfc822)
  # updated_at fails on virtual
  # cards, because not all to_s's take args (just actual dates)
end

#raw_feed_itemsObject



40
41
42
# File 'tmpsets/set/mod006-basic_formats/all/rss.rb', line 40

def raw_feed_items
  [card]
end

#show(view, args) ⇒ Object



16
17
18
19
# File 'tmpsets/set/mod006-basic_formats/all/rss.rb', line 16

def show view, args
  view ||= :feed
  render! view, args
end