Class: UEncode::CaptureOutput
- Inherits:
-
Object
- Object
- UEncode::CaptureOutput
- Defined in:
- lib/uencode/elements.rb
Constant Summary collapse
- ATTRIBUTES =
[:rate, :stretch, :crop, :zip, :prefix]
Instance Method Summary collapse
- #add_destination(dest) ⇒ Object
-
#initialize(options) ⇒ CaptureOutput
constructor
A new instance of CaptureOutput.
- #max_size ⇒ Object
- #max_size=(_max_size) ⇒ Object
- #overlay ⇒ Object
- #overlay=(_overlay) ⇒ Object
- #size ⇒ Object
- #size=(_size) ⇒ Object
- #to_xml ⇒ Object
Constructor Details
#initialize(options) ⇒ CaptureOutput
Returns a new instance of CaptureOutput.
139 140 141 142 |
# File 'lib/uencode/elements.rb', line 139 def initialize() @destinations = [] super end |
Instance Method Details
#add_destination(dest) ⇒ Object
144 145 146 |
# File 'lib/uencode/elements.rb', line 144 def add_destination(dest) @destinations << dest end |
#max_size ⇒ Object
162 163 164 |
# File 'lib/uencode/elements.rb', line 162 def max_size @max_size end |
#max_size=(_max_size) ⇒ Object
157 158 159 160 |
# File 'lib/uencode/elements.rb', line 157 def max_size=(_max_size) _max_size = MaxSize.new(_max_size) unless _max_size.instance_of?(MaxSize) || _max_size.nil? instance_variable_set :@max_size, _max_size end |
#overlay ⇒ Object
171 172 173 |
# File 'lib/uencode/elements.rb', line 171 def @overlay end |
#overlay=(_overlay) ⇒ Object
166 167 168 169 |
# File 'lib/uencode/elements.rb', line 166 def () = Overlay.new() unless .instance_of?(Overlay) || .nil? instance_variable_set :@overlay, end |
#size ⇒ Object
153 154 155 |
# File 'lib/uencode/elements.rb', line 153 def size @size end |
#size=(_size) ⇒ Object
148 149 150 151 |
# File 'lib/uencode/elements.rb', line 148 def size=(_size) _size = Size.new(_size) unless _size.instance_of?(Size) || _size.nil? instance_variable_set :@size, _size end |
#to_xml ⇒ Object
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/uencode/elements.rb', line 175 def to_xml %Q{ <capture> <rate>#{rate}</rate> #{!zip.nil? ? '<zip>' + zip.to_s + '</zip>' : ""} #{!prefix.nil? ? '<prefix>' + prefix.to_s + '</prefix>' : ""} <destinations> #{@destinations.inject("") { |s, dest| s << dest.to_xml}} </destinations> #{@size ? @size.to_xml : ""} #{@max_size ? @max_size.to_xml : ""} #{@overlay ? @overlay.to_xml : ""} </capture> } end |