Class: OpsmanagerClient::Product
- Inherits:
-
Object
- Object
- OpsmanagerClient::Product
- Defined in:
- lib/opsmanager_client/product.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize(path) ⇒ Product
constructor
A new instance of Product.
- #name ⇒ Object
- #to_s ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(path) ⇒ Product
Returns a new instance of Product.
15 16 17 |
# File 'lib/opsmanager_client/product.rb', line 15 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
13 14 15 |
# File 'lib/opsmanager_client/product.rb', line 13 def path @path end |
Instance Method Details
#file ⇒ Object
31 32 33 |
# File 'lib/opsmanager_client/product.rb', line 31 def file File.open(path) end |
#name ⇒ Object
23 24 25 |
# File 'lib/opsmanager_client/product.rb', line 23 def name filename_without_extension[/(p\-[a-z0-9]+)\-/i, 1] end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/opsmanager_client/product.rb', line 19 def to_s "#{name} v#{version}" end |
#version ⇒ Object
27 28 29 |
# File 'lib/opsmanager_client/product.rb', line 27 def version filename_without_extension[/#{name}\-(.+)$/, 1] end |