Class: BeginningOpenSource::Issues

Inherits:
Object
  • Object
show all
Defined in:
lib/beginning_open_source/issues.rb

Constant Summary collapse

@@all =
[]
@@starred =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(issues_hash) ⇒ Issues

Returns a new instance of Issues.



8
9
10
11
12
13
14
15
16
# File 'lib/beginning_open_source/issues.rb', line 8

def initialize(issues_hash)
  issues_hash.each {|key, value| self.send(("#{key}="), value)}
  @@all << self
  unless @stars == nil
    if @stars > 0          
      @@starred << self
    end
  end
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



2
3
4
# File 'lib/beginning_open_source/issues.rb', line 2

def body
  @body
end

#created_atObject

Returns the value of attribute created_at.



2
3
4
# File 'lib/beginning_open_source/issues.rb', line 2

def created_at
  @created_at
end

#html_urlObject

Returns the value of attribute html_url.



2
3
4
# File 'lib/beginning_open_source/issues.rb', line 2

def html_url
  @html_url
end

#labelsObject

Returns the value of attribute labels.



2
3
4
# File 'lib/beginning_open_source/issues.rb', line 2

def labels
  @labels
end

#repo_descriptionObject

Returns the value of attribute repo_description.



2
3
4
# File 'lib/beginning_open_source/issues.rb', line 2

def repo_description
  @repo_description
end

#repo_nameObject

Returns the value of attribute repo_name.



2
3
4
# File 'lib/beginning_open_source/issues.rb', line 2

def repo_name
  @repo_name
end

#repo_urlObject

Returns the value of attribute repo_url.



2
3
4
# File 'lib/beginning_open_source/issues.rb', line 2

def repo_url
  @repo_url
end

#starsObject

Returns the value of attribute stars.



2
3
4
# File 'lib/beginning_open_source/issues.rb', line 2

def stars
  @stars
end

#titleObject

Returns the value of attribute title.



2
3
4
# File 'lib/beginning_open_source/issues.rb', line 2

def title
  @title
end

Class Method Details

.allObject



24
25
26
# File 'lib/beginning_open_source/issues.rb', line 24

def self.all
  @@all
end

.create_from_collection(issues_array) ⇒ Object



18
19
20
21
22
# File 'lib/beginning_open_source/issues.rb', line 18

def self.create_from_collection(issues_array)
  issues_array.each do |issue|
    BeginningOpenSource::Issues.new(issue)
  end
end

.starredObject



28
29
30
# File 'lib/beginning_open_source/issues.rb', line 28

def self.starred
  @@starred
end