Class: Fabricators::Fetcher

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Fetcher.



4
5
6
7
8
# File 'lib/fabricators/fetcher.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/fetcher.rb', line 14

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

Instance Method Details

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



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

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