Class: Colonization::ModelField

Inherits:
ModelEntity show all
Defined in:
lib/colonization/model_field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, field, values_generator, strategy) ⇒ ModelField



8
9
10
11
12
13
# File 'lib/colonization/model_field.rb', line 8

def initialize(model, field, values_generator, strategy)
  @model = model
  @field = field
  @values_generator = values_generator
  @strategy = strategy
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



6
7
8
# File 'lib/colonization/model_field.rb', line 6

def field
  @field
end

#modelObject (readonly)

Returns the value of attribute model.



6
7
8
# File 'lib/colonization/model_field.rb', line 6

def model
  @model
end

#strategyObject (readonly)

Returns the value of attribute strategy.



6
7
8
# File 'lib/colonization/model_field.rb', line 6

def strategy
  @strategy
end

Instance Method Details

#nameObject



15
16
17
# File 'lib/colonization/model_field.rb', line 15

def name
  field
end

#valueObject



19
20
21
# File 'lib/colonization/model_field.rb', line 19

def value
  values_generator.call
end