Class: ImageOptim::BinResolver::Bin

Inherits:
Object
  • Object
show all
Defined in:
lib/image_optim/bin_resolver.rb

Overview

Holds name and version of an executable

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version) ⇒ Bin

Returns a new instance of Bin.



19
20
21
22
# File 'lib/image_optim/bin_resolver.rb', line 19

def initialize(name, version)
  @name = name
  @version = version && SimpleVersion.new(version)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



18
19
20
# File 'lib/image_optim/bin_resolver.rb', line 18

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



18
19
20
# File 'lib/image_optim/bin_resolver.rb', line 18

def version
  @version
end

Instance Method Details

#to_sObject



24
25
26
# File 'lib/image_optim/bin_resolver.rb', line 24

def to_s
  "#{@name} #{@version || '-'}"
end