Class: Sbmt::Strangler::Action

Inherits:
Object
  • Object
show all
Extended by:
Configurable
Defined in:
lib/sbmt/strangler/action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Configurable

option

Constructor Details

#initialize(name, controller) {|_self| ... } ⇒ Action

Returns a new instance of Action.

Yields:

  • (_self)

Yield Parameters:



17
18
19
20
21
22
# File 'lib/sbmt/strangler/action.rb', line 17

def initialize(name, controller, &)
  @name = name
  @controller = controller

  yield(self)
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



15
16
17
# File 'lib/sbmt/strangler/action.rb', line 15

def controller
  @controller
end

#nameObject (readonly)

Returns the value of attribute name.



15
16
17
# File 'lib/sbmt/strangler/action.rb', line 15

def name
  @name
end

Instance Method Details

#full_nameObject



24
25
26
# File 'lib/sbmt/strangler/action.rb', line 24

def full_name
  "#{controller.name}##{name}"
end

#httpObject



28
29
30
# File 'lib/sbmt/strangler/action.rb', line 28

def http
  @http ||= ActiveSupport::InheritableOptions.new(controller.http)
end

#http_clientObject



32
33
34
# File 'lib/sbmt/strangler/action.rb', line 32

def http_client
  @http_client ||= Sbmt::Strangler::Http::Client.new(http_options: http)
end