Class: NodeVersion
- Inherits:
-
Array
- Object
- Array
- NodeVersion
- Defined in:
- lib/puppet/parser/functions/util/nodejs_functions.rb
Instance Method Summary collapse
- #<(cmp) ⇒ Object
- #==(cmp) ⇒ Object
- #>(cmp) ⇒ Object
-
#initialize(list) ⇒ NodeVersion
constructor
A new instance of NodeVersion.
Constructor Details
#initialize(list) ⇒ NodeVersion
Returns a new instance of NodeVersion.
4 5 6 |
# File 'lib/puppet/parser/functions/util/nodejs_functions.rb', line 4 def initialize(list) super(list.split('.').map { |e| e.to_i }) end |
Instance Method Details
#<(cmp) ⇒ Object
8 9 10 |
# File 'lib/puppet/parser/functions/util/nodejs_functions.rb', line 8 def <(cmp) (self <=> cmp) < 0 end |
#==(cmp) ⇒ Object
16 17 18 |
# File 'lib/puppet/parser/functions/util/nodejs_functions.rb', line 16 def ==(cmp) (self <=> cmp).zero? end |
#>(cmp) ⇒ Object
12 13 14 |
# File 'lib/puppet/parser/functions/util/nodejs_functions.rb', line 12 def >(cmp) (self <=> cmp) > 0 end |