Class: Valkyrie::ID
- Inherits:
-
Object
- Object
- Valkyrie::ID
- Defined in:
- lib/valkyrie/id.rb
Overview
A simple ID class to keep IDs distinguished from strings
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean (also: #==)
-
#initialize(id) ⇒ ID
constructor
A new instance of ID.
- #to_s ⇒ Object
- #to_uri ⇒ Object
Constructor Details
#initialize(id) ⇒ ID
Returns a new instance of ID.
7 8 9 |
# File 'lib/valkyrie/id.rb', line 7 def initialize(id) @id = id.to_s end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/valkyrie/id.rb', line 5 def id @id end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
17 18 19 |
# File 'lib/valkyrie/id.rb', line 17 def eql?(other) other.class == self.class && other.state == state end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/valkyrie/id.rb', line 11 def to_s id end |