Class: SeedMigration::RegisterEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/seed_migration/register_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ RegisterEntry

Returns a new instance of RegisterEntry.



6
7
8
9
# File 'lib/seed_migration/register_entry.rb', line 6

def initialize(model)
  @model = model
  @attributes = model.attribute_names.dup
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



4
5
6
# File 'lib/seed_migration/register_entry.rb', line 4

def attributes
  @attributes
end

#modelObject (readonly)

Returns the value of attribute model.



3
4
5
# File 'lib/seed_migration/register_entry.rb', line 3

def model
  @model
end

Instance Method Details

#eql?(object) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/seed_migration/register_entry.rb', line 15

def eql?(object)
  object.class == self.class && object.model == self.model
end

#exclude(*attrs) ⇒ Object



11
12
13
# File 'lib/seed_migration/register_entry.rb', line 11

def exclude(*attrs)
  attrs.map(&:to_s).each { |attr| exclude_single_attributes attr }
end

#hashObject



19
20
21
# File 'lib/seed_migration/register_entry.rb', line 19

def hash
  model.hash
end