Class: Sbmt::Strangler::Action
- Inherits:
-
Object
- Object
- Sbmt::Strangler::Action
- Extended by:
- Configurable
- Defined in:
- lib/sbmt/strangler/action.rb,
lib/sbmt/strangler/action/composition/step.rb,
lib/sbmt/strangler/action/composition/metrics.rb,
lib/sbmt/strangler/action/composition/errors/max_level_error.rb,
lib/sbmt/strangler/action/composition/errors/configuration_error.rb
Defined Under Namespace
Modules: Composition
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #composition ⇒ Object
- #composition? ⇒ Boolean
- #full_name ⇒ Object
- #http ⇒ Object
- #http_client ⇒ Object
-
#initialize(name, controller) {|_self| ... } ⇒ Action
constructor
A new instance of Action.
Methods included from Configurable
Constructor Details
#initialize(name, controller) {|_self| ... } ⇒ Action
Returns a new instance of Action.
19 20 21 22 23 24 |
# File 'lib/sbmt/strangler/action.rb', line 19 def initialize(name, controller, &) @name = name @controller = controller yield(self) end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
17 18 19 |
# File 'lib/sbmt/strangler/action.rb', line 17 def controller @controller end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/sbmt/strangler/action.rb', line 17 def name @name end |
Instance Method Details
#composition ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/sbmt/strangler/action.rb', line 38 def composition(&) if block_given? @composition ||= Composition::Step.new(name: :root) yield(@composition) end @composition end |
#composition? ⇒ Boolean
46 47 48 |
# File 'lib/sbmt/strangler/action.rb', line 46 def composition? !composition.nil? end |
#full_name ⇒ Object
26 27 28 |
# File 'lib/sbmt/strangler/action.rb', line 26 def full_name "#{controller.name}##{name}" end |
#http ⇒ Object
30 31 32 |
# File 'lib/sbmt/strangler/action.rb', line 30 def http @http ||= ActiveSupport::InheritableOptions.new(controller.http) end |