Class: RailsEdgeTest::Dsl::Controller

Inherits:
Struct
  • Object
show all
Defined in:
lib/rails_edge_test/dsl/controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Controller

Returns a new instance of Controller.



3
4
5
6
7
# File 'lib/rails_edge_test/dsl/controller.rb', line 3

def initialize(*args)
  super
  @actions = []
  @let_handler = LetHandler.new
end

Instance Attribute Details

#controller_classObject

Returns the value of attribute controller_class

Returns:

  • (Object)

    the current value of controller_class



2
3
4
# File 'lib/rails_edge_test/dsl/controller.rb', line 2

def controller_class
  @controller_class
end

Instance Method Details

#__actionsObject



19
20
21
# File 'lib/rails_edge_test/dsl/controller.rb', line 19

def __actions
  @actions
end

#__let_handlerObject



23
24
25
# File 'lib/rails_edge_test/dsl/controller.rb', line 23

def __let_handler
  @let_handler
end

#action(name, &block) ⇒ Object



9
10
11
12
13
# File 'lib/rails_edge_test/dsl/controller.rb', line 9

def action(name, &block)
  new_action = Action.new(name, self)
  new_action.instance_exec(&block)
  @actions << new_action
end

#let(title, &block) ⇒ Object



15
16
17
# File 'lib/rails_edge_test/dsl/controller.rb', line 15

def let(title, &block)
  @let_handler.add_definition(title, &block)
end