Module: FixtureOverlord::FixtureAccessor

Extended by:
FixtureAccessor
Included in:
ClassMethods, FixtureAccessor
Defined in:
lib/fixture_overlord/fixture_accessor.rb

Instance Method Summary collapse

Instance Method Details

#fixture_overlord(setting = nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fixture_overlord/fixture_accessor.rb', line 9

def fixture_overlord(setting = nil)
  return unless setting.to_sym == :rule
  yaml_files.each do |yaml|

    # creates the hash version of the model
    define_method(yaml_filename(yaml)) do |key|
      hash            = FixtureOverlord.read_fixture(yaml, key)
      hash.yaml_file  = Helpers.yaml_filename(yaml)
      hash
    end

  end
end

#rootObject



23
24
25
# File 'lib/fixture_overlord/fixture_accessor.rb', line 23

def root
  @root ||= ::Pathname.new(Dir.pwd)
end