Class: ConfigBuilder::Model::Provider::SoftLayer::LoadBalancer

Inherits:
Base
  • Object
show all
Defined in:
lib/config_builder/model/provider/softlayer.rb

Instance Method Summary collapse

Methods inherited from Base

#attr, #attrs=, #call, #configure!, def_model_attribute, def_model_delegator, def_model_id, def_model_option, #eval_models, #instance_id, #instance_options, model_attributes, model_delegators, #model_delegators, model_options, new_from_hash, #with_attr

Instance Method Details

#service_group_optsObject



73
74
75
76
77
78
79
80
# File 'lib/config_builder/model/provider/softlayer.rb', line 73

def service_group_opts
  h = {}
  with_attr(:method) { |val| h[:method] = val }
  with_attr(:port)   { |val| h[:port] = val }
  with_attr(:type)   { |val| h[:type] = val }
  with_attr(:vip)    { |val| h[:vip] = val }
  h
end

#to_procObject



63
64
65
66
67
68
69
70
71
# File 'lib/config_builder/model/provider/softlayer.rb', line 63

def to_proc
  Proc.new do |config|
    config.join_load_balancer service_group_opts do |service|
      with_attr(:destination_port) { |val| service.destination_port = val }
      with_attr(:health_check)     { |val| service.health_check = val }
      with_attr(:weight)           { |val| service.weight = val }
    end
  end
end