Class: Weneedfeed::Application
- Inherits:
-
Hibana::Application
- Object
- Hibana::Application
- Weneedfeed::Application
- Defined in:
- lib/weneedfeed/application.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(schema_path:) ⇒ Application
constructor
A new instance of Application.
- #paths ⇒ Array<String>
Constructor Details
#initialize(schema_path:) ⇒ Application
Returns a new instance of Application.
14 15 16 17 |
# File 'lib/weneedfeed/application.rb', line 14 def initialize(schema_path:) @schema = ::Weneedfeed::Schema.load_file(schema_path) super() end |
Instance Method Details
#call(env) ⇒ Object
20 21 22 23 |
# File 'lib/weneedfeed/application.rb', line 20 def call(env) env['weneedfeed.schema'] = @schema super end |
#paths ⇒ Array<String>
26 27 28 29 30 31 32 33 |
# File 'lib/weneedfeed/application.rb', line 26 def paths %w[ / /opml.xml ] + @schema.page_ids.map do |page_id| "/feeds/#{page_id}.xml" end end |