Class: Bookbinder::CfRoutes
- Inherits:
-
Object
- Object
- Bookbinder::CfRoutes
- Defined in:
- lib/bookbinder/values/cf_routes.rb
Instance Method Summary collapse
- #apps_by_host_and_domain ⇒ Object
-
#initialize(raw_routes) ⇒ CfRoutes
constructor
A new instance of CfRoutes.
Constructor Details
#initialize(raw_routes) ⇒ CfRoutes
Returns a new instance of CfRoutes.
3 4 5 |
# File 'lib/bookbinder/values/cf_routes.rb', line 3 def initialize(raw_routes) @raw_routes = raw_routes end |
Instance Method Details
#apps_by_host_and_domain ⇒ Object
7 8 9 10 11 12 |
# File 'lib/bookbinder/values/cf_routes.rb', line 7 def apps_by_host_and_domain @apps_by_host_and_domain ||= data(raw_routes).reduce({}) {|acc, row| parsed_row = Hash[headers(raw_routes).zip(row)] acc.merge(parsed_row.values_at('host', 'domain') => parse_apps(parsed_row['apps'])) } end |