Class: Lite::Uxid::Reversible::Base
- Inherits:
-
Object
- Object
- Lite::Uxid::Reversible::Base
- Includes:
- Base
- Defined in:
- lib/lite/uxid/reversible/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, opts = {}) ⇒ Base
constructor
A new instance of Base.
Methods included from Base
Constructor Details
#initialize(id, opts = {}) ⇒ Base
Returns a new instance of Base.
12 13 14 15 |
# File 'lib/lite/uxid/reversible/base.rb', line 12 def initialize(id, opts = {}) @id = id @opts = opts end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/lite/uxid/reversible/base.rb', line 10 def id @id end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
10 11 12 |
# File 'lib/lite/uxid/reversible/base.rb', line 10 def opts @opts end |
Class Method Details
.decode(id, opts = {}) ⇒ Object
22 23 24 25 |
# File 'lib/lite/uxid/reversible/base.rb', line 22 def self.decode(id, opts = {}) klass = new(id, opts) klass.decode end |
.encode(id, opts = {}) ⇒ Object
17 18 19 20 |
# File 'lib/lite/uxid/reversible/base.rb', line 17 def self.encode(id, opts = {}) klass = new(id, opts) klass.encode end |