Class: CoolId::Id

Inherits:
Struct
  • Object
show all
Defined in:
lib/cool_id.rb

Overview

Struct representing a parsed CoolId.

Instance Attribute Summary collapse

Instance Attribute Details

#idString

The full ID (prefix + separator + key).

Returns:

  • (String)

    the current value of id



33
34
35
# File 'lib/cool_id.rb', line 33

def id
  @id
end

#id_fieldSymbol

The field in the model used to store the ID.

Returns:

  • (Symbol)

    the current value of id_field



33
34
35
# File 'lib/cool_id.rb', line 33

def id_field
  @id_field
end

#keyString

The unique part of the ID (excluding prefix and separator).

Returns:

  • (String)

    the current value of key



33
34
35
# File 'lib/cool_id.rb', line 33

def key
  @key
end

#model_classClass

The ActiveRecord model class associated with this ID.

Returns:

  • (Class)

    the current value of model_class



33
34
35
# File 'lib/cool_id.rb', line 33

def model_class
  @model_class
end

#prefixString

The prefix of the ID.

Returns:

  • (String)

    the current value of prefix



33
34
35
# File 'lib/cool_id.rb', line 33

def prefix
  @prefix
end