Class: BreakingNews::Article
- Inherits:
-
Object
- Object
- BreakingNews::Article
- Defined in:
- lib/breaking_news/article.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#headline ⇒ Object
Returns the value of attribute headline.
-
#p1 ⇒ Object
Returns the value of attribute p1.
-
#p2 ⇒ Object
Returns the value of attribute p2.
-
#p3 ⇒ Object
Returns the value of attribute p3.
-
#p4 ⇒ Object
Returns the value of attribute p4.
-
#p5 ⇒ Object
Returns the value of attribute p5.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Article
constructor
A new instance of Article.
Constructor Details
#initialize(hash) ⇒ Article
Returns a new instance of Article.
4 5 6 7 8 9 10 11 12 |
# File 'lib/breaking_news/article.rb', line 4 def initialize(hash) @headline = hash[:headline] @date = hash[:date] @p1 = hash[:p1] @p2 = hash[:p2] @p3 = hash[:p3] @p4 = hash[:p4] @p5 = hash[:p5] end |
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
2 3 4 |
# File 'lib/breaking_news/article.rb', line 2 def date @date end |
#headline ⇒ Object
Returns the value of attribute headline.
2 3 4 |
# File 'lib/breaking_news/article.rb', line 2 def headline @headline end |
#p1 ⇒ Object
Returns the value of attribute p1.
2 3 4 |
# File 'lib/breaking_news/article.rb', line 2 def p1 @p1 end |
#p2 ⇒ Object
Returns the value of attribute p2.
2 3 4 |
# File 'lib/breaking_news/article.rb', line 2 def p2 @p2 end |
#p3 ⇒ Object
Returns the value of attribute p3.
2 3 4 |
# File 'lib/breaking_news/article.rb', line 2 def p3 @p3 end |
#p4 ⇒ Object
Returns the value of attribute p4.
2 3 4 |
# File 'lib/breaking_news/article.rb', line 2 def p4 @p4 end |
#p5 ⇒ Object
Returns the value of attribute p5.
2 3 4 |
# File 'lib/breaking_news/article.rb', line 2 def p5 @p5 end |