Class: VIN::Id
- Inherits:
-
Object
- Object
- VIN::Id
- Defined in:
- lib/vin/id.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #custom_timestamp ⇒ Object
- #data_type ⇒ Object
-
#initialize(id:, config: nil) ⇒ Id
constructor
A new instance of Id.
- #logical_shard_id ⇒ Object
- #sequence ⇒ Object
- #timestamp ⇒ Object
Constructor Details
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/vin/id.rb', line 3 def config @config end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/vin/id.rb', line 3 def id @id end |
Instance Method Details
#custom_timestamp ⇒ Object
10 11 12 |
# File 'lib/vin/id.rb', line 10 def (id & ) >> config. end |
#data_type ⇒ Object
22 23 24 |
# File 'lib/vin/id.rb', line 22 def data_type (id & data_type_map) >> config.data_type_shift end |
#logical_shard_id ⇒ Object
18 19 20 |
# File 'lib/vin/id.rb', line 18 def logical_shard_id (id & logical_shard_id_map) >> config.logical_shard_id_shift end |
#sequence ⇒ Object
26 27 28 |
# File 'lib/vin/id.rb', line 26 def sequence (id & sequence_map) >> config.sequence_shift end |