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
10 11 12 13 14 15 16 17 |
# File 'lib/has_unique_identifier/class_methods.rb', line 10 def has_unique_identifier(name, opts = {}) raise ArgumentError if name.blank? @unique_identifier = OpenStruct.new( name: name, options: opts ) end |
#unique_identifier ⇒ Object
3 4 5 6 7 8 |
# File 'lib/has_unique_identifier/class_methods.rb', line 3 def unique_identifier return @unique_identifier if @unique_identifier if superclass.respond_to?(:unique_identifier) return superclass.unique_identifier end end |