Class: ImageOptim::BinResolver::Bin
- Inherits:
-
Object
- Object
- ImageOptim::BinResolver::Bin
- Defined in:
- lib/image_optim/bin_resolver.rb
Overview
Holds name and version of an executable
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(name, version) ⇒ Bin
constructor
A new instance of Bin.
- #to_s ⇒ Object
Constructor Details
#initialize(name, version) ⇒ Bin
20 21 22 23 |
# File 'lib/image_optim/bin_resolver.rb', line 20 def initialize(name, version) @name = name @version = version && SimpleVersion.new(version) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
19 20 21 |
# File 'lib/image_optim/bin_resolver.rb', line 19 def name @name end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
19 20 21 |
# File 'lib/image_optim/bin_resolver.rb', line 19 def version @version end |
Instance Method Details
#to_s ⇒ Object
25 26 27 |
# File 'lib/image_optim/bin_resolver.rb', line 25 def to_s "#{@name} #{@version || '-'}" end |