Class: Codily::Elements::Gzip

Inherits:
ServiceBelonggingBase show all
Defined in:
lib/codily/elements/gzip.rb

Instance Attribute Summary

Attributes inherited from Base

#fastly_obj, #root

Instance Method Summary collapse

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



35
36
37
# File 'lib/codily/elements/gzip.rb', line 35

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

#content_types(o = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/codily/elements/gzip.rb', line 7

def content_types(o = nil)
  o = case o
      when nil
        nil
      when String
        o
      when Array
        o.join(' ')
      end
  getset :content_types, o
end

#extensions(o = nil) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/codily/elements/gzip.rb', line 19

def extensions(o = nil)
  o = case o
      when nil
        nil
      when String
        o
      when Array
        o.join(' ')
      end
  getset :extensions, o
end

#fastly_classObject



39
40
41
# File 'lib/codily/elements/gzip.rb', line 39

def fastly_class
  Fastly::Gzip
end

#setupObject



31
32
33
# File 'lib/codily/elements/gzip.rb', line 31

def setup
  delete_if_empty! :cache_condition
end