Class: Egree::ReferenceId
- Inherits:
-
Object
- Object
- Egree::ReferenceId
- Includes:
- Comparable
- Defined in:
- lib/egree/reference_id.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(id) ⇒ ReferenceId
constructor
A new instance of ReferenceId.
- #to_s ⇒ Object
Constructor Details
#initialize(id) ⇒ ReferenceId
Returns a new instance of ReferenceId.
13 14 15 |
# File 'lib/egree/reference_id.rb', line 13 def initialize id @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
11 12 13 |
# File 'lib/egree/reference_id.rb', line 11 def id @id end |
Class Method Details
.generate ⇒ Object
7 8 9 |
# File 'lib/egree/reference_id.rb', line 7 def self.generate new SecureRandom.uuid end |
Instance Method Details
#<=>(other) ⇒ Object
21 22 23 |
# File 'lib/egree/reference_id.rb', line 21 def <=> other other.is_a?(self.class) && self.id <=> other.id end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/egree/reference_id.rb', line 17 def to_s id.to_s end |