Class: AwsRo::ElasticLoadBalancingV2::Rule
- Inherits:
-
Object
- Object
- AwsRo::ElasticLoadBalancingV2::Rule
- Extended by:
- Forwardable
- Defined in:
- lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Instance Method Summary collapse
- #forward_target_group ⇒ Object
- #host_header ⇒ Object
-
#initialize(rule, client) ⇒ Rule
constructor
A new instance of Rule.
- #path_pattern ⇒ Object
Constructor Details
#initialize(rule, client) ⇒ Rule
50 51 52 53 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 50 def initialize(rule, client) @rule = rule @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
46 47 48 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 46 def client @client end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
46 47 48 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 46 def rule @rule end |
Instance Method Details
#forward_target_group ⇒ Object
55 56 57 58 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 55 def forward_target_group action = rule.actions.find { |act| act.type == 'forward' } TargetGroup.new(action.target_group_arn, client) if action end |
#host_header ⇒ Object
65 66 67 68 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 65 def host_header condition = rule.conditions.find { |cond| cond.field == 'host-header' } condition.values.first if condition end |
#path_pattern ⇒ Object
60 61 62 63 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 60 def path_pattern condition = rule.conditions.find { |cond| cond.field == 'path-pattern' } condition.values.first if condition end |