Class: RubyPitaya::HandlerBase

Inherits:
Object
  • Object
show all
Defined in:
lib/rubypitaya/core/handler_base.rb

Direct Known Subclasses

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
  @redis = nil
  @setup = nil
  @config = nil
  @params = nil
  @session = nil
  @postman = nil

  @bll = self.class.bll
end

Instance Attribute Details

#bllObject (readonly)

Returns the value of attribute bll.



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

def bll
  @bll
end

#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

#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

#redisObject (readonly)

Returns the value of attribute redis.



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

def redis
  @redis
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

.bllObject



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

def self.bll
  self.handler_bll ||= InstanceHolder.new
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

Instance Method Details

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



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

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