Module: ActiveInteractor::Context::AttributeAssignment

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/active_interactor/context/attribute_assignment.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_id, *arguments) ⇒ Object (protected)



34
35
36
37
38
39
40
41
# File 'lib/active_interactor/context/attribute_assignment.rb', line 34

def method_missing(method_id, *arguments)
  return super unless respond_to_missing?(method_id)

  method_name = method_id[/.*(?==\z)/m]
  return assignment_method_missing(method_name, *arguments) if method_name

  read_attribute_value(method_id)
end

Instance Method Details

#[](attribute_name) ⇒ Object



8
9
10
# File 'lib/active_interactor/context/attribute_assignment.rb', line 8

def [](attribute_name)
  read_attribute_value(attribute_name)
end

#[]=(attribute_name, value) ⇒ Object



12
13
14
# File 'lib/active_interactor/context/attribute_assignment.rb', line 12

def []=(attribute_name, value)
  assign_attribute_value(attribute_name, value)
end