Class: WowzaRest::Data::Application::TranscoderConfig

Inherits:
Base
  • Object
show all
Defined in:
lib/wowza_rest/data/application.rb

Defined Under Namespace

Classes: Template

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#define_key_getter, #include?, #keys_reader, #objects_array_to_hash_array, #setup_attributes, #to_json, #wrap_array_objects

Constructor Details

#initialize(attrs = {}) ⇒ TranscoderConfig

Returns a new instance of TranscoderConfig.



37
38
39
40
41
42
43
44
45
# File 'lib/wowza_rest/data/application.rb', line 37

def initialize(attrs = {})
  if !attrs.nil? &&  attrs['templates']
    keys_reader :templates
    @templates = wrap_array_objects(
      attrs.delete('templates')['templates'], Template
    )
  end
  super(attrs)
end

Instance Attribute Details

#templatesObject (readonly)

Returns the value of attribute templates.



35
36
37
# File 'lib/wowza_rest/data/application.rb', line 35

def templates
  @templates
end

Instance Method Details

#to_hObject



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/wowza_rest/data/application.rb', line 47

def to_h
  super() do |k, arr|
    if k == :@templates
      {
        templates: objects_array_to_hash_array(arr)
      }
    else
      objects_array_to_hash_array(arr)
    end
  end
end