Class: Codily::Elements::ResponseObject

Inherits:
ServiceBelonggingBase show all
Includes:
FileLoadable
Defined in:
lib/codily/elements/response_object.rb

Instance Attribute Summary

Attributes inherited from Base

#fastly_obj, #root

Instance Method Summary collapse

Methods included from FileLoadable

included

Methods inherited from ServiceBelonggingBase

#as_hash, #initialize, #key, parent_class, #parent_key, #service_id, #service_name

Methods inherited from Base

#as_dsl_hash, #as_hash, def_attr, defaults, #dsl_args, #id, #initialize, #inspect, #key, #name, name_for_attr, #parent, #parent_class, parent_class, #parent_key, #parents, path

Constructor Details

This class inherits a constructor from Codily::Elements::ServiceBelonggingBase

Instance Method Details

#cache_condition(name = nil, &block) ⇒ Object



38
39
40
# File 'lib/codily/elements/response_object.rb', line 38

def cache_condition(name = nil, &block)
  set_refer_element(:cache_condition, Condition, {name: name, type: 'CACHE', _service_name: self.service_name}, &block)
end

#content(obj = nil) ⇒ Object



34
35
36
# File 'lib/codily/elements/response_object.rb', line 34

def content(obj = nil)
  getset :content, file_loadable(obj)
end

#fastly_classObject



46
47
48
# File 'lib/codily/elements/response_object.rb', line 46

def fastly_class
  Fastly::ResponseObject
end

#request_condition(name = nil, &block) ⇒ Object



42
43
44
# File 'lib/codily/elements/response_object.rb', line 42

def request_condition(name = nil, &block)
  set_refer_element(:request_condition, Condition, {name: name, type: 'REQUEST', _service_name: self.service_name}, &block)
end

#setupObject



24
25
26
27
28
29
30
31
32
# File 'lib/codily/elements/response_object.rb', line 24

def setup
  delete_if_empty! *i(
    content
    content_type
    response
    cache_condition
    request_condition
  )
end