Class: MagicLamp::FixturesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/magic_lamp/fixtures_controller.rb

Constant Summary collapse

ERRORS =
[
  "ArgumentError",
  "MagicLamp::AlreadyRegisteredFixtureError",
  "MagicLamp::AmbiguousFixtureNameError",
  "MagicLamp::UnregisteredFixtureError"
]

Instance Method Summary collapse

Instance Method Details

#indexObject



21
22
23
# File 'app/controllers/magic_lamp/fixtures_controller.rb', line 21

def index
  render json: namespace.generate_all_fixtures
end

#showObject



16
17
18
19
# File 'app/controllers/magic_lamp/fixtures_controller.rb', line 16

def show
  namespace.load_lamp_files
  render text: namespace.generate_fixture(params[:name])
end