Yapra::Plugin::FeedItemOperator

Constants

LOCAL_VAL_RE

Public Instance Methods

set_attribute_to(item, k, value) click to toggle source
# File lib/yapra/plugin/feed_item_operator.rb, line 6
def set_attribute_to item, k, value
  raise NameError unless LOCAL_VAL_RE =~ k
  unless item.respond_to?("#{k}=")
    item.instance_eval %{
      def #{k}
        @#{k}
      end
      def #{k}= v
        @#{k} = v
      end
    }, __FILE__, __LINE__
    
  end
  item.__send__("#{k}=", value)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.