Class: Codily::Elements::Backend

Inherits:
ServiceBelonggingBase show all
Includes:
FileLoadable
Defined in:
lib/codily/elements/backend.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

#fastly_classObject



73
74
75
# File 'lib/codily/elements/backend.rb', line 73

def fastly_class
  Fastly::Backend
end

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



65
66
67
# File 'lib/codily/elements/backend.rb', line 65

def healthcheck(name = nil, &block)
  set_refer_element(:healthcheck, Healthcheck, {name: name, _service_name: self.service_name}, &block)
end

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



69
70
71
# File 'lib/codily/elements/backend.rb', line 69

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

#setupObject



22
23
24
25
26
27
28
29
30
31
# File 'lib/codily/elements/backend.rb', line 22

def setup
  delete_if_empty!(*i(
    hostname
    address
    request_condition
    healthcheck
    comment
    shield
  ))
end