Class: Codily::Elements::RequestSetting
Instance Attribute Summary
Attributes inherited from Base
#fastly_obj, #root
Instance Method Summary
collapse
#initialize, #key, parent_class, #parent_key, #service_id, #service_name
Methods inherited from Base
#as_dsl_hash, def_attr, defaults, #dsl_args, #id, #initialize, #inspect, #key, #name, name_for_attr, #parent, #parent_class, parent_class, #parent_key, #parents, path
Instance Method Details
#as_hash ⇒ Object
50
51
52
53
54
55
56
|
# File 'lib/codily/elements/request_setting.rb', line 50
def as_hash
super.tap do |x|
i(force_ssl force_miss timer_support bypass_busy_wait).each do |k|
x[k] = !!x[k] ? 1 : 0 if x.key?(k) && !x[k].nil?
end
end
end
|
#fastly_class ⇒ Object
62
63
64
|
# File 'lib/codily/elements/request_setting.rb', line 62
def fastly_class
Fastly::RequestSetting
end
|
#request_condition(name = nil, &block) ⇒ Object
58
59
60
|
# File 'lib/codily/elements/request_setting.rb', line 58
def request_condition(name = nil, &block)
set_refer_element(:request_condition, Condition, {name: name, type: 'REQUEST', _service_name: self.service_name}, &block)
end
|
#setup ⇒ Object
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/codily/elements/request_setting.rb', line 29
def setup
delete_if_empty! *i(
default_host
hash_keys
request_condition
)
force_integer! *i(
force_ssl
force_miss
timer_support
bypass_busy_wait
max_stale_age
)
i(force_ssl force_miss timer_support bypass_busy_wait).each do |k|
@hash[k] = @hash[k] == 1 if @hash.key?(k)
end
end
|