Class: CoolId::Config
- Inherits:
-
Object
- Object
- CoolId::Config
- Defined in:
- lib/cool_id.rb
Instance Attribute Summary collapse
-
#alphabet ⇒ Object
readonly
Returns the value of attribute alphabet.
-
#id_field ⇒ Object
readonly
Returns the value of attribute id_field.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#max_retries ⇒ Object
readonly
Returns the value of attribute max_retries.
-
#model_class ⇒ Object
readonly
Returns the value of attribute model_class.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Instance Method Summary collapse
-
#initialize(prefix:, model_class:, length: nil, alphabet: nil, max_retries: nil, id_field: nil) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(prefix:, model_class:, length: nil, alphabet: nil, max_retries: nil, id_field: nil) ⇒ Config
Returns a new instance of Config.
98 99 100 101 102 103 104 105 |
# File 'lib/cool_id.rb', line 98 def initialize(prefix:, model_class:, length: nil, alphabet: nil, max_retries: nil, id_field: nil) @length = length @prefix = validate_prefix(prefix) @alphabet = validate_alphabet(alphabet) @max_retries = max_retries @model_class = model_class @id_field = id_field end |
Instance Attribute Details
#alphabet ⇒ Object (readonly)
Returns the value of attribute alphabet.
96 97 98 |
# File 'lib/cool_id.rb', line 96 def alphabet @alphabet end |
#id_field ⇒ Object (readonly)
Returns the value of attribute id_field.
96 97 98 |
# File 'lib/cool_id.rb', line 96 def id_field @id_field end |
#length ⇒ Object (readonly)
Returns the value of attribute length.
96 97 98 |
# File 'lib/cool_id.rb', line 96 def length @length end |
#max_retries ⇒ Object (readonly)
Returns the value of attribute max_retries.
96 97 98 |
# File 'lib/cool_id.rb', line 96 def max_retries @max_retries end |
#model_class ⇒ Object (readonly)
Returns the value of attribute model_class.
96 97 98 |
# File 'lib/cool_id.rb', line 96 def model_class @model_class end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
96 97 98 |
# File 'lib/cool_id.rb', line 96 def prefix @prefix end |