Class: Bookbinder::Deploy::CfRoutes

Inherits:
Object
  • Object
show all
Defined in:
lib/bookbinder/deploy/cf_routes.rb

Instance Method Summary collapse

Constructor Details

#initialize(raw_routes) ⇒ CfRoutes

Returns a new instance of CfRoutes.



4
5
6
# File 'lib/bookbinder/deploy/cf_routes.rb', line 4

def initialize(raw_routes)
  @raw_routes = raw_routes
end

Instance Method Details

#apps_by_host_and_domainObject



8
9
10
11
12
13
# File 'lib/bookbinder/deploy/cf_routes.rb', line 8

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