Class: Govuk::DummyContentStore::Content
- Inherits:
-
Object
- Object
- Govuk::DummyContentStore::Content
- Defined in:
- lib/govuk/dummy_content_store/content.rb
Instance Attribute Summary collapse
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(repository) ⇒ Content
constructor
A new instance of Content.
Constructor Details
#initialize(repository) ⇒ Content
Returns a new instance of Content.
10 11 12 |
# File 'lib/govuk/dummy_content_store/content.rb', line 10 def initialize(repository) @repository = repository end |
Instance Attribute Details
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
8 9 10 |
# File 'lib/govuk/dummy_content_store/content.rb', line 8 def repository @repository end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/govuk/dummy_content_store/content.rb', line 14 def call(env) example = repository.find_by_base_path(env["PATH_INFO"]) if example present_example(example) else present_not_found end end |