Class: ActiveRecord::FixtureBuilder::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/fixture_builder/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fixture_builder, path) ⇒ Builder

Returns a new instance of Builder.



3
4
5
# File 'lib/active_record/fixture_builder/builder.rb', line 3

def initialize fixture_builder, path
  @fixture_builder, @path = fixture_builder, path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/active_record/fixture_builder/builder.rb', line 6

def path
  @path
end

Instance Method Details

#build!Object



8
9
10
# File 'lib/active_record/fixture_builder/builder.rb', line 8

def build!
  load @path
end

#inspectObject



12
13
14
15
# File 'lib/active_record/fixture_builder/builder.rb', line 12

def inspect
  path = @path.relative_path_from(@fixture_builder.config.fixtures_path)
  %[#<#{self.class} #{path.to_s}>]
end