Class: Amiba::Source::Feed
- Inherits:
-
Object
- Object
- Amiba::Source::Feed
- Includes:
- Amiba::Source
- Defined in:
- lib/amiba/source/feed.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #content=(c) ⇒ Object
- #filename ⇒ Object
-
#initialize(fn) ⇒ Feed
constructor
A new instance of Feed.
- #link ⇒ Object
- #output_filename ⇒ Object
Methods included from Amiba::Source
Constructor Details
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
8 9 10 |
# File 'lib/amiba/source/feed.rb', line 8 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/amiba/source/feed.rb', line 8 def type @type end |
Instance Method Details
#content=(c) ⇒ Object
17 18 19 |
# File 'lib/amiba/source/feed.rb', line 17 def content=(c) @content ||= self.new? ? c : File.read(filename) end |
#filename ⇒ Object
13 14 15 |
# File 'lib/amiba/source/feed.rb', line 13 def filename @filename ||= File.join("feeds", "#{@name}.#{@type}.builder") end |
#link ⇒ Object
25 26 27 |
# File 'lib/amiba/source/feed.rb', line 25 def link URI.escape "/#{name}.#{type}" end |
#output_filename ⇒ Object
21 22 23 |
# File 'lib/amiba/source/feed.rb', line 21 def output_filename File.join(Amiba::Configuration.site_dir, "public/#{name}.#{type}") end |