Class: SimplestStatus::ModelMethods

Inherits:
Object
  • Object
show all
Defined in:
lib/simplest_status/model_methods.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, statuses) ⇒ ModelMethods

Returns a new instance of ModelMethods.



5
6
7
8
# File 'lib/simplest_status/model_methods.rb', line 5

def initialize(model, statuses)
  @model    = model
  @statuses = statuses
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



3
4
5
# File 'lib/simplest_status/model_methods.rb', line 3

def model
  @model
end

#statusesObject (readonly)

Returns the value of attribute statuses.



3
4
5
# File 'lib/simplest_status/model_methods.rb', line 3

def statuses
  @statuses
end

Instance Method Details

#addObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/simplest_status/model_methods.rb', line 10

def add
  define_statuses_accessor_for statuses

  populate_statuses

  process_each_status

  define_status_label_method_for statuses

  set_validations_for statuses
end