Class: RubyPitaya::HandlerBase

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/core/handler_base.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rubypitaya-3.12.1/lib/rubypitaya/core/handler_base.rb

Direct Known Subclasses

ErrorHandler, HelloWorldHandler, PlayerHandler

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHandlerBase

Returns a new instance of HandlerBase.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rubypitaya/core/handler_base.rb', line 12

def initialize
  @log = nil
  @services = nil
  @setup = nil
  @config = nil
  @params = nil
  @session = nil
  @postman = nil

  @objects = self.class.objects
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



10
11
12
# File 'lib/rubypitaya/core/handler_base.rb', line 10

def config
  @config
end

#logObject (readonly)

Returns the value of attribute log.



10
11
12
# File 'lib/rubypitaya/core/handler_base.rb', line 10

def log
  @log
end

#objectsObject (readonly)

Returns the value of attribute objects.



10
11
12
# File 'lib/rubypitaya/core/handler_base.rb', line 10

def objects
  @objects
end

#paramsObject (readonly)

Returns the value of attribute params.



10
11
12
# File 'lib/rubypitaya/core/handler_base.rb', line 10

def params
  @params
end

#postmanObject (readonly)

Returns the value of attribute postman.



10
11
12
# File 'lib/rubypitaya/core/handler_base.rb', line 10

def postman
  @postman
end

#servicesObject (readonly)

Returns the value of attribute services.



10
11
12
# File 'lib/rubypitaya/core/handler_base.rb', line 10

def services
  @services
end

#sessionObject (readonly)

Returns the value of attribute session.



10
11
12
# File 'lib/rubypitaya/core/handler_base.rb', line 10

def session
  @session
end

#setupObject (readonly)

Returns the value of attribute setup.



10
11
12
# File 'lib/rubypitaya/core/handler_base.rb', line 10

def setup
  @setup
end

Class Method Details

.authenticated_action_name?(action_name) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/rubypitaya/core/handler_base.rb', line 43

def self.authenticated_action_name?(action_name)
  !self.non_authenticated_routes.include?(action_name.to_s)
end

.non_authenticated_actions(*action_names) ⇒ Object



39
40
41
# File 'lib/rubypitaya/core/handler_base.rb', line 39

def self.non_authenticated_actions(*action_names)
  self.non_authenticated_routes = action_names.map(&:to_s)
end

.objectsObject



34
35
36
37
# File 'lib/rubypitaya/core/handler_base.rb', line 34

def self.objects
  self.handler_objects ||= InstanceHolder.new
  return self.handler_objects
end

Instance Method Details

#set_attributes(log, services, setup, config, params, session, postman) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/rubypitaya/core/handler_base.rb', line 24

def set_attributes(log, services, setup, config, params, session, postman)
  @log = log
  @services = services
  @setup = setup
  @config = config
  @params = params
  @session = session
  @postman = postman
end