Class: ConvenientService::Support::UniqueValue
- Inherits:
-
Object
- Object
- ConvenientService::Support::UniqueValue
- Defined in:
- lib/convenient_service/support/unique_value.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
- #==(other) ⇒ Boolean
- #===(other) ⇒ Boolean
- #eql?(other) ⇒ Boolean
- #initialize(label = default_label) ⇒ void constructor
- #inspect ⇒ String
Constructor Details
#initialize(label = default_label) ⇒ void
16 17 18 |
# File 'lib/convenient_service/support/unique_value.rb', line 16 def initialize(label = default_label) @label = label end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
10 11 12 |
# File 'lib/convenient_service/support/unique_value.rb', line 10 def label @label end |
Instance Method Details
#==(other) ⇒ Boolean
27 28 29 30 31 |
# File 'lib/convenient_service/support/unique_value.rb', line 27 def ==(other) return unless other.instance_of?(self.class) object_id == other.object_id end |
#===(other) ⇒ Boolean
37 38 39 |
# File 'lib/convenient_service/support/unique_value.rb', line 37 def ===(other) self == other end |
#eql?(other) ⇒ Boolean
48 49 50 |
# File 'lib/convenient_service/support/unique_value.rb', line 48 def eql?(other) self == other end |
#inspect ⇒ String
55 56 57 58 59 60 |
# File 'lib/convenient_service/support/unique_value.rb', line 55 def inspect return default_label if label.nil? return default_label if label.empty? label end |