Class: CfCacheBehavior
- Inherits:
-
Object
- Object
- CfCacheBehavior
- Includes:
- CfInner
- Defined in:
- lib/cf_factory/cloudfront/cf_cache_behavior.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #additional_indent ⇒ Object
- #get_cf_attributes ⇒ Object
-
#initialize(target_origin_id, forwarded_values, viewer_protocol_policy, path_pattern, options) ⇒ CfCacheBehavior
constructor
A new instance of CfCacheBehavior.
Methods included from CfInner
#generate, #generate_name, #set_quotes
Constructor Details
#initialize(target_origin_id, forwarded_values, viewer_protocol_policy, path_pattern, options) ⇒ CfCacheBehavior
Returns a new instance of CfCacheBehavior.
16 17 18 19 20 21 22 23 24 |
# File 'lib/cf_factory/cloudfront/cf_cache_behavior.rb', line 16 def initialize(target_origin_id, forwarded_values, viewer_protocol_policy, path_pattern, ) @target_origin_id = target_origin_id @forwarded_values = forwarded_values @forwarded_values.add(2) @view_protocol_policy = viewer_protocol_policy @path_pattern = path_pattern @min_ttl = [:min_ttl] @trusted_signers = [:trusted_signers] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/cf_factory/cloudfront/cf_cache_behavior.rb', line 6 def id @id end |
Class Method Details
.create_basic(target_origin_id, path_pattern, options = {}) ⇒ Object
12 13 14 |
# File 'lib/cf_factory/cloudfront/cf_cache_behavior.rb', line 12 def self.create_basic(target_origin_id, path_pattern, = {}) CfCacheBehavior.new(target_origin_id, CfForwardedValues.new(true), "allow-all", path_pattern, ) end |
Instance Method Details
#additional_indent ⇒ Object
8 9 10 |
# File 'lib/cf_factory/cloudfront/cf_cache_behavior.rb', line 8 def additional_indent 6 end |
#get_cf_attributes ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cf_factory/cloudfront/cf_cache_behavior.rb', line 26 def get_cf_attributes result = {} result["TargetOriginId"] = @target_origin_id result["ForwardedValues"] = @forwarded_values.generate result["ViewerProtocolPolicy"] = @view_protocol_policy result["PathPattern"] = @path_pattern result["MinTTL"] = @min_ttl unless @min_ttl.nil? result["TrustedSigners"] = @trusted_signers unless @trusted_signers.nil? result end |