Class: Agent212::Product
- Inherits:
-
Object
- Object
- Agent212::Product
- Defined in:
- lib/agent212/product.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(name, version = nil) ⇒ Product
constructor
A new instance of Product.
- #to_s ⇒ Object
Constructor Details
#initialize(name, version = nil) ⇒ Product
Returns a new instance of Product.
6 7 8 9 |
# File 'lib/agent212/product.rb', line 6 def initialize(name, version = nil) @name = name @version = version end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/agent212/product.rb', line 4 def name @name end |
#version ⇒ Object
Returns the value of attribute version.
4 5 6 |
# File 'lib/agent212/product.rb', line 4 def version @version end |
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/agent212/product.rb', line 11 def to_s if @version "#{@name}/#{@version}" else @name.to_s end end |