Class: Sbmt::Strangler::Controller
- Inherits:
-
Object
- Object
- Sbmt::Strangler::Controller
- Extended by:
- Configurable
- Defined in:
- lib/sbmt/strangler/controller.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #action(name) ⇒ Object
- #http ⇒ Object
-
#initialize(name, configuration) {|_self| ... } ⇒ Controller
constructor
A new instance of Controller.
Methods included from Configurable
Constructor Details
#initialize(name, configuration) {|_self| ... } ⇒ Controller
Returns a new instance of Controller.
12 13 14 15 16 17 18 19 |
# File 'lib/sbmt/strangler/controller.rb', line 12 def initialize(name, configuration, &) @name = name @class_name = "#{name.camelize}Controller" @actions = [] @configuration = configuration yield(self) end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
10 11 12 |
# File 'lib/sbmt/strangler/controller.rb', line 10 def actions @actions end |
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
10 11 12 |
# File 'lib/sbmt/strangler/controller.rb', line 10 def class_name @class_name end |
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
10 11 12 |
# File 'lib/sbmt/strangler/controller.rb', line 10 def configuration @configuration end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/sbmt/strangler/controller.rb', line 10 def name @name end |
Instance Method Details
#action(name) ⇒ Object
21 22 23 |
# File 'lib/sbmt/strangler/controller.rb', line 21 def action(name, &) @actions.push(Sbmt::Strangler::Action.new(name, self, &)) end |
#http ⇒ Object
25 26 27 |
# File 'lib/sbmt/strangler/controller.rb', line 25 def http @http ||= ActiveSupport::InheritableOptions.new(configuration.http) end |