Class: RailsEdgeTest::Dsl::Controller
- Inherits:
-
Struct
- Object
- Struct
- RailsEdgeTest::Dsl::Controller
- Defined in:
- lib/rails_edge_test/dsl/controller.rb
Instance Attribute Summary collapse
-
#controller_class ⇒ Object
Returns the value of attribute controller_class.
Instance Method Summary collapse
- #__actions ⇒ Object
- #__let_handler ⇒ Object
- #action(name, &block) ⇒ Object
-
#initialize(*args) ⇒ Controller
constructor
A new instance of Controller.
- #let(title, &block) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Controller
Returns a new instance of Controller.
6 7 8 9 10 |
# File 'lib/rails_edge_test/dsl/controller.rb', line 6 def initialize(*args) super @actions = [] @let_handler = LetHandler.new end |
Instance Attribute Details
#controller_class ⇒ Object
Returns the value of attribute controller_class
5 6 7 |
# File 'lib/rails_edge_test/dsl/controller.rb', line 5 def controller_class @controller_class end |
Instance Method Details
#__actions ⇒ Object
22 23 24 |
# File 'lib/rails_edge_test/dsl/controller.rb', line 22 def __actions @actions end |
#__let_handler ⇒ Object
26 27 28 |
# File 'lib/rails_edge_test/dsl/controller.rb', line 26 def __let_handler @let_handler end |
#action(name, &block) ⇒ Object
12 13 14 15 16 |
# File 'lib/rails_edge_test/dsl/controller.rb', line 12 def action(name, &block) new_action = Action.new(name, self) new_action.instance_exec(&block) @actions << new_action end |
#let(title, &block) ⇒ Object
18 19 20 |
# File 'lib/rails_edge_test/dsl/controller.rb', line 18 def let(title, &block) @let_handler.add_definition(title, &block) end |