Class: Fabricators::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/fabricators/reader.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, options, &block) ⇒ Reader

Returns a new instance of Reader.



4
5
6
7
8
# File 'lib/fabricators/reader.rb', line 4

def initialize(name, options, &block)
  @name = name
  @options = options
  instance_eval &block
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



14
15
# File 'lib/fabricators/reader.rb', line 14

def method_missing(name, *args, &block)
end

Instance Method Details

#fabricator(name, options = {}, &block) ⇒ Object



10
11
12
# File 'lib/fabricators/reader.rb', line 10

def fabricator(name, options={}, &block)
  Fabricators.definitions.fabricator name, @options.merge(options.merge(parent: @name)), &block
end