Module: UEncode::AttrSetting
- Included in:
- Clip, Job, JobStatus, Metadata, Overlay, Position, RateElement, Response, SizeBase, Transfer, VideoOutput
- Defined in:
- lib/uencode.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
37 38 39 40 |
# File 'lib/uencode.rb', line 37 def self.included(klass) attr = klass.const_get "ATTRIBUTES" klass.send(:attr_reader, *attr) end |
Instance Method Details
#initialize(options) ⇒ Object
33 34 35 |
# File 'lib/uencode.rb', line 33 def initialize() set_attributes end |
#set_attributes(options) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/uencode.rb', line 20 def set_attributes() # self.class.const_get("ATTRIBUTES").each { |attr| instance_variable_set(:"@#{attr}", options[attr.to_sym] || options[attr.to_s]) } # options.each do |key, value| .each_pair { |key, value| if self.class.const_get("ATTRIBUTES").include?(key) instance_variable_set(:"@#{key}", value) else self.send("#{key}=", value) end } end |