Class: DelegateCached::ModelData

Inherits:
Object
  • Object
show all
Defined in:
lib/delegate_cached/model_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, column, association, reflection) ⇒ ModelData

Returns a new instance of ModelData.



5
6
7
8
9
10
# File 'lib/delegate_cached/model_data.rb', line 5

def initialize(model, column, association, reflection)
  @model = model
  @column = column
  @association = association
  @reflection = reflection
end

Instance Attribute Details

#associationObject (readonly)

Returns the value of attribute association.



3
4
5
# File 'lib/delegate_cached/model_data.rb', line 3

def association
  @association
end

#columnObject (readonly)

Returns the value of attribute column.



3
4
5
# File 'lib/delegate_cached/model_data.rb', line 3

def column
  @column
end

#modelObject (readonly)

Returns the value of attribute model.



3
4
5
# File 'lib/delegate_cached/model_data.rb', line 3

def model
  @model
end

#reflectionObject (readonly)

Returns the value of attribute reflection.



3
4
5
# File 'lib/delegate_cached/model_data.rb', line 3

def reflection
  @reflection
end

Instance Method Details

#plural_underscored_model_nameObject



12
13
14
# File 'lib/delegate_cached/model_data.rb', line 12

def plural_underscored_model_name
  model.to_s.pluralize.underscore
end

#underscored_model_nameObject



16
17
18
# File 'lib/delegate_cached/model_data.rb', line 16

def underscored_model_name
  model.to_s.underscore
end