Module: Swamp::Action::ClassMethods

Defined in:
lib/swamp/rails_actions/action.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exposuresObject

Returns the value of attribute exposures.



104
105
106
# File 'lib/swamp/rails_actions/action.rb', line 104

def exposures
  @exposures
end

Class Method Details

.extended(interactor) ⇒ Object



106
107
108
109
110
# File 'lib/swamp/rails_actions/action.rb', line 106

def self.extended(interactor)
  interactor.class_eval do
    self.exposures = {}
  end
end

Instance Method Details

#call(args = ) ⇒ Object



112
113
114
# File 'lib/swamp/rails_actions/action.rb', line 112

def call(args = Hash[])
  new.call(args)
end

#expose(*instance_variable_names) ⇒ Object



116
117
118
119
120
# File 'lib/swamp/rails_actions/action.rb', line 116

def expose(*instance_variable_names)
  instance_variable_names.each do |name|
    exposures[name.to_sym] = "@#{name}"
  end
end