Module: ActsAsKaltura::Delegator::ClassMethods

Defined in:
lib/acts_as_kaltura/delegator.rb

Instance Method Summary collapse

Instance Method Details

#delegates_kaltura_attributes(attrs) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/acts_as_kaltura/delegator.rb', line 12

def delegates_kaltura_attributes(attrs)
  attrs.each do |attr|
    # def thumbnail_url
    #   _lookup_local_attribute(:"thumbnail_url") || _lookup_kaltura_attribute(:"thumbnail_url")
    # end
    class_eval <<-RUBY
      def #{attr}
        self._lookup_local_attribute(:'#{attr.to_s}') ||
         self._lookup_kaltura_attribute(:'#{attr.to_s}')
      end
    RUBY
  end
end