Class: Govuk::DummyContentStore::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/govuk/dummy_content_store/index.rb

Defined Under Namespace

Classes: CleanBinding

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(example_repository) ⇒ Index

Returns a new instance of Index.



10
11
12
# File 'lib/govuk/dummy_content_store/index.rb', line 10

def initialize(example_repository)
  @example_repository = example_repository
end

Instance Attribute Details

#example_repositoryObject (readonly)

Returns the value of attribute example_repository.



8
9
10
# File 'lib/govuk/dummy_content_store/index.rb', line 8

def example_repository
  @example_repository
end

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/govuk/dummy_content_store/index.rb', line 14

def call(env)
  if env["PATH_INFO"] == "/"
    render_index
  else
    [404, {}, ["Not found"]]
  end
end