class RailsEdgeTest::Dsl::LetHandler

Attributes

let_blocks[R]

Public Class Methods

new() click to toggle source
# File lib/rails_edge_test/dsl/let_handler.rb, line 5
def initialize
  @let_blocks = {}
end

Public Instance Methods

add_definition(title, &block) click to toggle source
# File lib/rails_edge_test/dsl/let_handler.rb, line 9
def add_definition(title, &block)
  @let_blocks[title] = block
end
execute(title) click to toggle source
# File lib/rails_edge_test/dsl/let_handler.rb, line 13
def execute(title)
  block = @let_blocks[title]
  unless block
    fail NoMethodError, "no method or let block defined with name #{title}"
  end

  block.call
end