Class: Alephant::Preview::FixtureLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/alephant/preview/fixture_loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_path) ⇒ FixtureLoader

Returns a new instance of FixtureLoader.



6
7
8
9
# File 'lib/alephant/preview/fixture_loader.rb', line 6

def initialize(base_path)
  @base_path = base_path
  @fixtures  = Dir.glob("#{base_path}/fixtures/*")
end

Instance Attribute Details

#base_pathObject (readonly)

Returns the value of attribute base_path.



4
5
6
# File 'lib/alephant/preview/fixture_loader.rb', line 4

def base_path
  @base_path
end

#current_fixtureObject (readonly)

Returns the value of attribute current_fixture.



4
5
6
# File 'lib/alephant/preview/fixture_loader.rb', line 4

def current_fixture
  @current_fixture
end

#fixturesObject (readonly)

Returns the value of attribute fixtures.



4
5
6
# File 'lib/alephant/preview/fixture_loader.rb', line 4

def fixtures
  @fixtures
end

Instance Method Details

#get(_uri) ⇒ Object



11
12
13
14
15
16
# File 'lib/alephant/preview/fixture_loader.rb', line 11

def get(_uri)
  OpenStruct.new(
    status: 200,
    body:   fixture
  )
end