Class: QiitaScouter::Articles

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/models/articles.rb

Overview

QiitaScouter::Articles

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#articlesObject

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

#eachObject



26
27
28
# File 'lib/models/articles.rb', line 26

def each
  @articles.each { |article|yield(article) }
end

#sizeObject



22
23
24
# File 'lib/models/articles.rb', line 22

def size
  @articles.size
end