Class: SemverDialects::Boundary
- Inherits:
-
Object
- Object
- SemverDialects::Boundary
- Includes:
- Comparable
- Defined in:
- lib/semver_dialects/boundary.rb
Overview
rubocop:todo Style/Documentation
Instance Attribute Summary collapse
-
#semver ⇒ Object
Returns the value of attribute semver.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(semver) ⇒ Boundary
constructor
A new instance of Boundary.
-
#is_initial_version? ⇒ Boolean
rubocop:todo Naming/PredicateName.
- #to_s ⇒ Object
Constructor Details
#initialize(semver) ⇒ Boundary
Returns a new instance of Boundary.
12 13 14 |
# File 'lib/semver_dialects/boundary.rb', line 12 def initialize(semver) @semver = semver end |
Instance Attribute Details
#semver ⇒ Object
Returns the value of attribute semver.
10 11 12 |
# File 'lib/semver_dialects/boundary.rb', line 10 def semver @semver end |
Instance Method Details
#<=>(other) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/semver_dialects/boundary.rb', line 20 def <=>(other) return nil unless other.is_a?(Boundary) return -1 if other.instance_of?(AboveAll) return 1 if other.instance_of?(BelowAll) semver <=> other.semver end |
#is_initial_version? ⇒ Boolean
rubocop:todo Naming/PredicateName
28 29 30 |
# File 'lib/semver_dialects/boundary.rb', line 28 def is_initial_version? # rubocop:todo Naming/PredicateName @semver.is_zero? end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/semver_dialects/boundary.rb', line 16 def to_s @semver.to_s end |