Class: Govuk::DummyContentStore::ExampleRepository
- Inherits:
-
Object
- Object
- Govuk::DummyContentStore::ExampleRepository
- Defined in:
- lib/govuk/dummy_content_store/example_repository.rb
Instance Attribute Summary collapse
-
#content_schemas_path ⇒ Object
readonly
Returns the value of attribute content_schemas_path.
Instance Method Summary collapse
- #all ⇒ Object
- #find_by_base_path(base_path) ⇒ Object
-
#initialize(content_schemas_path) ⇒ ExampleRepository
constructor
A new instance of ExampleRepository.
Constructor Details
#initialize(content_schemas_path) ⇒ ExampleRepository
Returns a new instance of ExampleRepository.
9 10 11 |
# File 'lib/govuk/dummy_content_store/example_repository.rb', line 9 def initialize(content_schemas_path) @content_schemas_path = Pathname.new(content_schemas_path) end |
Instance Attribute Details
#content_schemas_path ⇒ Object (readonly)
Returns the value of attribute content_schemas_path.
7 8 9 |
# File 'lib/govuk/dummy_content_store/example_repository.rb', line 7 def content_schemas_path @content_schemas_path end |
Instance Method Details
#all ⇒ Object
17 18 19 |
# File 'lib/govuk/dummy_content_store/example_repository.rb', line 17 def all all_example_paths.lazy.map { |path| ExampleContentItem.new(path) } end |
#find_by_base_path(base_path) ⇒ Object
13 14 15 |
# File 'lib/govuk/dummy_content_store/example_repository.rb', line 13 def find_by_base_path(base_path) all.find { |item| item.base_path == base_path } end |