Class: Jets::Lambda::Functions

Inherits:
Object
  • Object
show all
Includes:
ExceptionReporting, Dsl
Defined in:
lib/jets/lambda/functions.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Dsl

#lambda_functions

Constructor Details

#initialize(event, context, meth) ⇒ Functions

Returns a new instance of Functions.



13
14
15
16
17
18
19
# File 'lib/jets/lambda/functions.rb', line 13

def initialize(event, context, meth)
  @event = HashWithIndifferentAccess.new(event) # Hash, JSON.parse(event) ran BaseProcessor
  @context = context # Hash. JSON.parse(context) ran in BaseProcessor
  @meth = meth
  # store meth because it is useful to for identifying the which template
  # to use later.
end

Class Attribute Details

.abstractObject (readonly) Also known as: abstract?

Returns the value of attribute abstract.



34
35
36
# File 'lib/jets/lambda/functions.rb', line 34

def abstract
  @abstract
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



12
13
14
# File 'lib/jets/lambda/functions.rb', line 12

def context
  @context
end

#eventObject (readonly)

Returns the value of attribute event.



12
13
14
# File 'lib/jets/lambda/functions.rb', line 12

def event
  @event
end

#methObject (readonly)

Returns the value of attribute meth.



12
13
14
# File 'lib/jets/lambda/functions.rb', line 12

def meth
  @meth
end

Class Method Details

._prefixesObject



54
55
56
# File 'lib/jets/lambda/functions.rb', line 54

def _prefixes
  []
end

.abstract!Object

Define a controller as abstract. See internal_methods for more details.



50
51
52
# File 'lib/jets/lambda/functions.rb', line 50

def abstract!
  @abstract = true
end

.inherited(base) ⇒ Object

:nodoc:



39
40
41
42
43
44
45
46
# File 'lib/jets/lambda/functions.rb', line 39

def inherited(klass) # :nodoc:
  # Define the abstract ivar on subclasses so that we don't get
  # uninitialized ivar warnings
  unless klass.instance_variable_defined?(:@abstract)
    klass.instance_variable_set(:@abstract, false)
  end
  super
end

.output_keysObject

Needed for depends_on. Got added due to stagger logic.



69
70
71
# File 'lib/jets/lambda/functions.rb', line 69

def output_keys
  []
end

.subclassesObject

Tracking subclasses because it helps with Lambda::Dsl#find_all_definitions



59
60
61
# File 'lib/jets/lambda/functions.rb', line 59

def subclasses
  @subclasses ||= []
end

Instance Method Details

#_normalize_options(options) ⇒ Object

Pretty hacky since action_view/rendering.rb _normalize_options calls super



29
30
31
# File 'lib/jets/lambda/functions.rb', line 29

def _normalize_options(options) # :doc:
  options
end

#loggerObject



21
22
23
# File 'lib/jets/lambda/functions.rb', line 21

def logger
  Jets.logger
end