Class: ToolVersion::Tool
- Inherits:
-
Object
- Object
- ToolVersion::Tool
- Includes:
- Comparable
- Defined in:
- lib/tool_version/tool.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(name, version, path) ⇒ Tool
constructor
A new instance of Tool.
Constructor Details
#initialize(name, version, path) ⇒ Tool
Returns a new instance of Tool.
9 10 11 12 13 14 |
# File 'lib/tool_version/tool.rb', line 9 def initialize(name, version, path) @name = name @version = version @path = path @directory = extract_directory(path) end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
7 8 9 |
# File 'lib/tool_version/tool.rb', line 7 def directory @directory end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/tool_version/tool.rb', line 7 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/tool_version/tool.rb', line 7 def path @path end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
7 8 9 |
# File 'lib/tool_version/tool.rb', line 7 def version @version end |
Instance Method Details
#<=>(other) ⇒ Object
16 17 18 |
# File 'lib/tool_version/tool.rb', line 16 def <=>(other) (name <=> other.name) && (version <=> other.version) && (directory <=> other.directory) && (path <=> other.path) end |