Class: Lite::Uxid::Irreversible::Base

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/lite/uxid/irreversible/base.rb

Direct Known Subclasses

Nanoid, Ulid, Uuid

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base

#encode

Constructor Details

#initialize(opts = {}) ⇒ Base

Returns a new instance of Base.



12
13
14
# File 'lib/lite/uxid/irreversible/base.rb', line 12

def initialize(opts = {})
  @opts = opts
end

Instance Attribute Details

#optsObject (readonly)

Returns the value of attribute opts.



10
11
12
# File 'lib/lite/uxid/irreversible/base.rb', line 10

def opts
  @opts
end

Class Method Details

.decode(opts = {}) ⇒ Object



21
22
23
24
# File 'lib/lite/uxid/irreversible/base.rb', line 21

def self.decode(opts = {})
  klass = new(opts)
  klass.decode
end

.encode(opts = {}) ⇒ Object



16
17
18
19
# File 'lib/lite/uxid/irreversible/base.rb', line 16

def self.encode(opts = {})
  klass = new(opts)
  klass.encode
end

Instance Method Details

#decodeObject



26
27
28
# File 'lib/lite/uxid/irreversible/base.rb', line 26

def decode
  raise "#{coder_class} does not support decoding"
end