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.



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_classObject

Returns the value of attribute controller_class

Returns:

  • (Object)

    the current value of controller_class



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

def controller_class
  @controller_class
end

Instance Method Details

#__actionsObject



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

def __actions
  @actions
end

#__let_handlerObject



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