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
-
#initialize(rule, client) ⇒ Rule
constructor
A new instance of Rule.
- #path_pattern ⇒ Object
Constructor Details
#initialize(rule, client) ⇒ Rule
Returns a new instance of Rule.
48 49 50 51 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 48 def initialize(rule, client) @rule = rule @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
44 45 46 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 44 def client @client end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
44 45 46 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 44 def rule @rule end |
Instance Method Details
#forward_target_group ⇒ Object
53 54 55 56 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 53 def forward_target_group action = rule.actions.find { |act| act.type == 'forward' } TargetGroup.new(action.target_group_arn, client) if action end |
#path_pattern ⇒ Object
58 59 60 61 |
# File 'lib/aws_ro/elastic_load_balancing_v2/load_balancer.rb', line 58 def path_pattern condition = rule.conditions.find { |cond| cond.field == 'path-pattern' } condition.values.first if condition end |