Class: Alephant::Preview::FixtureLoader
- Inherits:
-
Object
- Object
- Alephant::Preview::FixtureLoader
- Defined in:
- lib/alephant/preview/fixture_loader.rb
Instance Attribute Summary collapse
-
#base_path ⇒ Object
readonly
Returns the value of attribute base_path.
-
#current_fixture ⇒ Object
readonly
Returns the value of attribute current_fixture.
-
#fixtures ⇒ Object
readonly
Returns the value of attribute fixtures.
Instance Method Summary collapse
- #get(_uri) ⇒ Object
-
#initialize(base_path) ⇒ FixtureLoader
constructor
A new instance of FixtureLoader.
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_path ⇒ Object (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_fixture ⇒ Object (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 |
#fixtures ⇒ Object (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 |