Class: Citrus::Components::Session

Inherits:
Component
  • Object
show all
Defined in:
lib/citrus/components/session.rb

Overview

Session

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, args = {}) ⇒ Session

Initialize the component

Parameters:

  • app (Object)
  • args (Hash) (defaults to: {})


25
26
27
28
29
30
31
# File 'lib/citrus/components/session.rb', line 25

def initialize app, args={}
  @app = app
  @service = Common::Service::SessionService.new args

  this = self
  @app.define_singleton_method :session_service, proc{ this }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object

Proxy for connection service

Parameters:

  • name (String)


36
37
38
# File 'lib/citrus/components/session.rb', line 36

def method_missing name, *args, &block
  @service.send name, *args, &block
end

Instance Attribute Details

#serviceObject (readonly)

Returns the value of attribute service.



19
20
21
# File 'lib/citrus/components/session.rb', line 19

def service
  @service
end