Module: HasUniqueIdentifier::ClassMethods

Defined in:
lib/has_unique_identifier/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#has_unique_identifier(name, opts = {}) ⇒ Object

Raises:

  • (ArgumentError)


7
8
9
10
11
12
13
14
# File 'lib/has_unique_identifier/class_methods.rb', line 7

def has_unique_identifier(name, opts = {})
  raise ArgumentError if name.blank?

  @unique_identifier = OpenStruct.new(
    name: name,
    options: opts
  )
end

#unique_identifierObject



3
4
5
# File 'lib/has_unique_identifier/class_methods.rb', line 3

def unique_identifier
  @unique_identifier
end