Class: M2Config::Host
- Inherits:
-
Object
- Object
- M2Config::Host
- Defined in:
- lib/m2config/host.rb
Instance Method Summary collapse
- #check_routes ⇒ Object
-
#initialize(fields) ⇒ Host
constructor
A new instance of Host.
Constructor Details
#initialize(fields) ⇒ Host
Returns a new instance of Host.
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_routes ⇒ Object
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 |