class Bitmovin::Encoding::StreamOutput
Attributes
acl[RW]
output_id[RW]
output_path[RW]
Public Class Methods
new(hash = {})
click to toggle source
# File lib/bitmovin/encoding/stream_output.rb, line 3 def initialize(hash = {}) @errors = [] hash.each do |name, value| instance_variable_set("@#{ActiveSupport::Inflector.underscore(name)}", value) end end
Public Instance Methods
errors()
click to toggle source
# File lib/bitmovin/encoding/stream_output.rb, line 21 def errors @errors end
invalid?()
click to toggle source
# File lib/bitmovin/encoding/stream_output.rb, line 17 def invalid? !valid? end
to_json(args)
click to toggle source
# File lib/bitmovin/encoding/stream_output.rb, line 25 def to_json(args) collect_attributes.to_json(args) end
valid?()
click to toggle source
# File lib/bitmovin/encoding/stream_output.rb, line 12 def valid? validate! @errors.empty? end
Private Instance Methods
collect_attributes()
click to toggle source
# File lib/bitmovin/encoding/stream_output.rb, line 31 def collect_attributes val = Hash.new [:output_id, :output_path, :acl].each do |name| json_name = ActiveSupport::Inflector.camelize(name.to_s, false) val[json_name] = instance_variable_get("@#{name}") end val end
validate!()
click to toggle source
# File lib/bitmovin/encoding/stream_output.rb, line 40 def validate! @errors << "output_id cannot be blank" if @output_id.blank? @errors << "output_path cannot be blank" if @output_path.blank? end