Class: QiitaScouter::Articles
- Inherits:
-
Object
- Object
- QiitaScouter::Articles
- Includes:
- Enumerable
- Defined in:
- lib/models/articles.rb
Overview
QiitaScouter::Articles
Instance Attribute Summary collapse
-
#articles ⇒ Object
Returns the value of attribute articles.
Instance Method Summary collapse
- #+(other) ⇒ Object
- #<<(article) ⇒ Object
- #each ⇒ Object
-
#initialize(articles = []) ⇒ Articles
constructor
A new instance of Articles.
- #size ⇒ Object
Constructor Details
#initialize(articles = []) ⇒ Articles
Returns a new instance of Articles.
9 10 11 |
# File 'lib/models/articles.rb', line 9 def initialize(articles = []) @articles = articles end |
Instance Attribute Details
#articles ⇒ Object
Returns the value of attribute articles.
7 8 9 |
# File 'lib/models/articles.rb', line 7 def articles @articles end |
Instance Method Details
#+(other) ⇒ Object
17 18 19 20 |
# File 'lib/models/articles.rb', line 17 def +(other) @articles += other.articles self end |
#<<(article) ⇒ Object
13 14 15 |
# File 'lib/models/articles.rb', line 13 def <<(article) @articles << article end |
#each ⇒ Object
26 27 28 |
# File 'lib/models/articles.rb', line 26 def each @articles.each { |article|yield(article) } end |
#size ⇒ Object
22 23 24 |
# File 'lib/models/articles.rb', line 22 def size @articles.size end |