Class: SoftwareBinder::Software

Inherits:
Object
  • Object
show all
Defined in:
lib/software_binder/software.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(category) ⇒ Software

Returns a new instance of Software.



7
8
9
10
# File 'lib/software_binder/software.rb', line 7

def initialize(category)
  @category = category
  self.save
end

Instance Attribute Details

#categoryObject (readonly)

Returns the value of attribute category.



3
4
5
# File 'lib/software_binder/software.rb', line 3

def category
  @category
end

#descriptionObject

Returns the value of attribute description.



2
3
4
# File 'lib/software_binder/software.rb', line 2

def description
  @description
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/software_binder/software.rb', line 2

def name
  @name
end

#overall_ratingObject

Returns the value of attribute overall_rating.



2
3
4
# File 'lib/software_binder/software.rb', line 2

def overall_rating
  @overall_rating
end

#page_slugObject

Returns the value of attribute page_slug.



2
3
4
# File 'lib/software_binder/software.rb', line 2

def page_slug
  @page_slug
end

#reviewsObject

Returns the value of attribute reviews.



2
3
4
# File 'lib/software_binder/software.rb', line 2

def reviews
  @reviews
end

Class Method Details

.allObject



16
17
18
# File 'lib/software_binder/software.rb', line 16

def self.all
  @@all
end

.resetObject



20
21
22
# File 'lib/software_binder/software.rb', line 20

def self.reset
  @@all.clear
end

Instance Method Details

#saveObject



12
13
14
# File 'lib/software_binder/software.rb', line 12

def save
  @@all << self
end