Class: Dropdown::Post
- Inherits:
-
Object
- Object
- Dropdown::Post
- Defined in:
- lib/dropdown/post.rb
Instance Attribute Summary collapse
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #author ⇒ Object
- #body ⇒ Object
- #date ⇒ Object
- #excerpt ⇒ Object
-
#initialize(source, reader) ⇒ Post
constructor
A new instance of Post.
- #title ⇒ Object
Constructor Details
#initialize(source, reader) ⇒ Post
Returns a new instance of Post.
29 30 31 32 |
# File 'lib/dropdown/post.rb', line 29 def initialize(source, reader) @source = source @reader = reader end |
Instance Attribute Details
#reader ⇒ Object (readonly)
Returns the value of attribute reader.
3 4 5 |
# File 'lib/dropdown/post.rb', line 3 def reader @reader end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
3 4 5 |
# File 'lib/dropdown/post.rb', line 3 def source @source end |
Instance Method Details
#author ⇒ Object
9 10 11 |
# File 'lib/dropdown/post.rb', line 9 def [:author] end |
#body ⇒ Object
17 18 19 |
# File 'lib/dropdown/post.rb', line 17 def body content end |
#date ⇒ Object
13 14 15 |
# File 'lib/dropdown/post.rb', line 13 def date Date.parse [:date] end |
#excerpt ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/dropdown/post.rb', line 21 def excerpt unless @excerpt extractor = Dropdown::Parsers::ExcerptExtractor.new(content) @excerpt = extractor.extract end @excerpt end |
#title ⇒ Object
5 6 7 |
# File 'lib/dropdown/post.rb', line 5 def title [:title] end |