Class: Weneedfeed::Application

Inherits:
Hibana::Application
  • Object
show all
Defined in:
lib/weneedfeed/application.rb

Instance Method Summary collapse

Constructor Details

#initialize(schema_path:) ⇒ Application

Returns a new instance of Application.

Parameters:

  • schema_path (String)


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

Parameters:

  • env (Hash)


20
21
22
23
# File 'lib/weneedfeed/application.rb', line 20

def call(env)
  env['weneedfeed.schema'] = @schema
  super
end

#pathsArray<String>

Returns:

  • (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