Class: Lam::BaseController

Inherits:
Object
  • Object
show all
Defined in:
lib/lam/base_controller.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event, context) ⇒ BaseController

Returns a new instance of BaseController.



6
7
8
9
# File 'lib/lam/base_controller.rb', line 6

def initialize(event, context)
  @event = event
  @context = context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



5
6
7
# File 'lib/lam/base_controller.rb', line 5

def context
  @context
end

#eventObject (readonly)

Returns the value of attribute event.



5
6
7
# File 'lib/lam/base_controller.rb', line 5

def event
  @event
end

Class Method Details

.lambda_functionsObject



20
21
22
# File 'lib/lam/base_controller.rb', line 20

def self.lambda_functions
  new(nil, nil).lambda_functions
end

Instance Method Details

#lambda_functionsObject

The public methods defined in the user’s custom class will become lambda functions. Returns Example:

["FakeController#handler1", "FakeController#handler2"]


15
16
17
18
# File 'lib/lam/base_controller.rb', line 15

def lambda_functions
  # public_instance_methods(false) - to not include inherited methods
  self.class.public_instance_methods(false) - Object.public_instance_methods
end