Class: Fvm::CLI::Installation
- Inherits:
-
Object
- Object
- Fvm::CLI::Installation
- Includes:
- Comparable
- Defined in:
- lib/fvm/cli/installation.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #active? ⇒ Boolean
-
#initialize(dir) ⇒ Installation
constructor
A new instance of Installation.
- #to_menu ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(dir) ⇒ Installation
Returns a new instance of Installation.
10 11 12 |
# File 'lib/fvm/cli/installation.rb', line 10 def initialize( dir ) @dir = Pathname.new( dir ). end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
9 10 11 |
# File 'lib/fvm/cli/installation.rb', line 9 def dir @dir end |
Instance Method Details
#<=>(other) ⇒ Object
28 29 30 |
# File 'lib/fvm/cli/installation.rb', line 28 def <=> ( other ) Versionomy.parse( version ) <=> Versionomy.parse( other.version ) end |
#active? ⇒ Boolean
18 19 20 |
# File 'lib/fvm/cli/installation.rb', line 18 def active? Fvm::System.active?( self ) end |
#to_menu ⇒ Object
22 23 24 25 26 |
# File 'lib/fvm/cli/installation.rb', line 22 def out = [ version ] out.unshift '*' if active? out.join ' ' end |
#version ⇒ Object
14 15 16 |
# File 'lib/fvm/cli/installation.rb', line 14 def version @dir.basename.to_s.sub( /^flex_sdk_/, '' ) end |