Class: SmartphoneFinder::Device
- Inherits:
-
Object
- Object
- SmartphoneFinder::Device
- Extended by:
- HelperMethods
- Includes:
- HelperMethods
- Defined in:
- lib/smartphone_finder/device.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#brand ⇒ Object
Returns the value of attribute brand.
-
#name ⇒ Object
Returns the value of attribute name.
-
#specifications ⇒ Object
Returns the value of attribute specifications.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, url, brand = nil) ⇒ Device
constructor
A new instance of Device.
Methods included from HelperMethods
Constructor Details
#initialize(name, url, brand = nil) ⇒ Device
Returns a new instance of Device.
8 9 10 11 12 13 14 15 16 |
# File 'lib/smartphone_finder/device.rb', line 8 def initialize(name,url,brand=nil) @specifications=nil @name=name @url=url @brand=brand if ! obj_exist? @@all.push(self) end end |
Instance Attribute Details
#brand ⇒ Object
Returns the value of attribute brand.
7 8 9 |
# File 'lib/smartphone_finder/device.rb', line 7 def brand @brand end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/smartphone_finder/device.rb', line 7 def name @name end |
#specifications ⇒ Object
Returns the value of attribute specifications.
7 8 9 |
# File 'lib/smartphone_finder/device.rb', line 7 def specifications @specifications end |
#url ⇒ Object
Returns the value of attribute url.
7 8 9 |
# File 'lib/smartphone_finder/device.rb', line 7 def url @url end |
Class Method Details
.all ⇒ Object
18 19 20 |
# File 'lib/smartphone_finder/device.rb', line 18 def self.all @@all end |