Class: M2Config::Host

Inherits:
Object
  • Object
show all
Defined in:
lib/m2config/host.rb

Instance Method Summary collapse

Constructor Details

#initialize(fields) ⇒ Host

Returns a new instance of Host.

Raises:

  • (ArgumentError)


5
6
7
8
9
10
11
# File 'lib/m2config/host.rb', line 5

def initialize( fields )
  s = resolveServer fields
  fields[:server_id] = s.id if s
  raise ArgumentError, "Name can not be nil" if fields[:name].nil?
  super fields, false
  save
end

Instance Method Details

#check_routesObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/m2config/host.rb', line 13

def check_routes
  paths = routes(true).map {
    |route|
    route.path
  }
#      return true if paths.empty?
  
#      return "#{paths.uniq.to_s} == #{paths.to_s}"
  paths.uniq.size == paths.size
end