Class: Hako::Schedulers::EcsServiceDiscoveryServiceComparator
- Inherits:
-
Object
- Object
- Hako::Schedulers::EcsServiceDiscoveryServiceComparator
- Defined in:
- lib/hako/schedulers/ecs_service_discovery_service_comparator.rb
Instance Method Summary collapse
- #different?(actual_service) ⇒ Boolean
- #dns_config_schema ⇒ Object private
- #dns_records_schema ⇒ Object private
-
#initialize(expected_service) ⇒ EcsServiceDiscoveryServiceComparator
constructor
A new instance of EcsServiceDiscoveryServiceComparator.
- #service_schema ⇒ Object private
Constructor Details
#initialize(expected_service) ⇒ EcsServiceDiscoveryServiceComparator
Returns a new instance of EcsServiceDiscoveryServiceComparator.
9 10 11 12 |
# File 'lib/hako/schedulers/ecs_service_discovery_service_comparator.rb', line 9 def initialize(expected_service) @expected_service = expected_service @schema = service_schema end |
Instance Method Details
#different?(actual_service) ⇒ Boolean
16 17 18 |
# File 'lib/hako/schedulers/ecs_service_discovery_service_comparator.rb', line 16 def different?(actual_service) !@schema.same?(actual_service.to_h, @expected_service) end |
#dns_config_schema ⇒ Object (private)
29 30 31 32 33 |
# File 'lib/hako/schedulers/ecs_service_discovery_service_comparator.rb', line 29 def dns_config_schema Schema::Structure.new.tap do |struct| struct.member(:dns_records, Schema::UnorderedArray.new(dns_records_schema)) end end |
#dns_records_schema ⇒ Object (private)
35 36 37 38 39 40 |
# File 'lib/hako/schedulers/ecs_service_discovery_service_comparator.rb', line 35 def dns_records_schema Schema::Structure.new.tap do |struct| struct.member(:ttl, Schema::Integer.new) struct.member(:type, Schema::String.new) end end |
#service_schema ⇒ Object (private)
22 23 24 25 26 27 |
# File 'lib/hako/schedulers/ecs_service_discovery_service_comparator.rb', line 22 def service_schema Schema::Structure.new.tap do |struct| struct.member(:description, Schema::Nullable.new(Schema::String.new)) struct.member(:dns_config, dns_config_schema) end end |