Module: FunctionalLightService::Organizer::Macros

Defined in:
lib/functional-light-service/organizer.rb

Instance Method Summary collapse

Instance Method Details

#after_actions(*logic) ⇒ Object

This looks like an accessor, but it's used as a macro in the Organizer



100
101
102
# File 'lib/functional-light-service/organizer.rb', line 100

def after_actions(*logic)
  self.after_actions = logic
end

#after_actions=(logic) ⇒ Object



104
105
106
# File 'lib/functional-light-service/organizer.rb', line 104

def after_actions=(logic)
  @after_actions = logic.nil? ? nil : [logic].flatten
end

#aliases(key_hash) ⇒ Object



75
76
77
# File 'lib/functional-light-service/organizer.rb', line 75

def aliases(key_hash)
  @aliases = key_hash
end

#append_after_actions(action) ⇒ Object



108
109
110
111
# File 'lib/functional-light-service/organizer.rb', line 108

def append_after_actions(action)
  @after_actions ||= []
  @after_actions.push(action)
end

#append_before_actions(action) ⇒ Object



89
90
91
92
# File 'lib/functional-light-service/organizer.rb', line 89

def append_before_actions(action)
  @before_actions ||= []
  @before_actions.push(action)
end

#before_actions(*logic) ⇒ Object

This looks like an accessor, but it's used as a macro in the Organizer



81
82
83
# File 'lib/functional-light-service/organizer.rb', line 81

def before_actions(*logic)
  self.before_actions = logic
end

#before_actions=(logic) ⇒ Object



85
86
87
# File 'lib/functional-light-service/organizer.rb', line 85

def before_actions=(logic)
  @before_actions = logic.nil? ? nil : [logic].flatten
end

#remove_before_actions(action) ⇒ Object



94
95
96
# File 'lib/functional-light-service/organizer.rb', line 94

def remove_before_actions(action)
  @before_actions&.delete(action)
end