Class: Jsapi::Status::Base
- Inherits:
-
Object
- Object
- Jsapi::Status::Base
- Includes:
- Comparable
- Defined in:
- lib/jsapi/status/base.rb
Instance Attribute Summary collapse
-
#priority ⇒ Object
readonly
Returns the value of attribute priority.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#<=>(other) ⇒ Object
:nodoc:.
-
#==(other) ⇒ Object
(also: #eql?)
:nodoc:.
-
#initialize(value, priority:) ⇒ Base
constructor
A new instance of Base.
-
#inspect ⇒ Object
:nodoc:.
Constructor Details
#initialize(value, priority:) ⇒ Base
Returns a new instance of Base.
12 13 14 15 |
# File 'lib/jsapi/status/base.rb', line 12 def initialize(value, priority:) @priority = priority @value = value end |
Instance Attribute Details
#priority ⇒ Object (readonly)
Returns the value of attribute priority.
8 9 10 |
# File 'lib/jsapi/status/base.rb', line 8 def priority @priority end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'lib/jsapi/status/base.rb', line 8 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
:nodoc:
23 24 25 26 27 28 |
# File 'lib/jsapi/status/base.rb', line 23 def <=>(other) # :nodoc: result = priority <=> other.priority return result unless result.zero? value <=> other.value end |
#==(other) ⇒ Object Also known as: eql?
:nodoc:
17 18 19 |
# File 'lib/jsapi/status/base.rb', line 17 def ==(other) # :nodoc: other.is_a?(self.class) && other.value == value end |
#inspect ⇒ Object
:nodoc:
30 31 32 |
# File 'lib/jsapi/status/base.rb', line 30 def inspect # :nodoc: "#<#{self.class} #{value.inspect}>" end |