class OpsmanagerClient::Product
Attributes
path[R]
Public Class Methods
new(path)
click to toggle source
# File lib/opsmanager_client/product.rb, line 15 def initialize(path) @path = path end
Public Instance Methods
file()
click to toggle source
# File lib/opsmanager_client/product.rb, line 31 def file File.open(path) end
name()
click to toggle source
# File lib/opsmanager_client/product.rb, line 23 def name filename_without_extension[/(p\-[a-z0-9]+)\-/i, 1] end
to_s()
click to toggle source
# File lib/opsmanager_client/product.rb, line 19 def to_s "#{name} v#{version}" end
version()
click to toggle source
# File lib/opsmanager_client/product.rb, line 27 def version filename_without_extension[/#{name}\-(.+)$/, 1] end
Private Instance Methods
filename_without_extension()
click to toggle source
# File lib/opsmanager_client/product.rb, line 37 def filename_without_extension File.basename(path, ".*") end