# File lib/twitter/identity.rb, line 7 def self.fetch(attrs) return unless identity_map id = attrs[:id] if id && object = identity_map.fetch(id) return object.update(attrs) end return yield if block_given? raise Twitter::Error::IdentityMapKeyError, "key not found" end
Initializes a new object
@param attrs [Hash] @raise [ArgumentError] Error raised when supplied argument is missing an :id key. @return [Twitter::Identity]
# File lib/twitter/identity.rb, line 33 def initialize(attrs={}) super raise ArgumentError, "argument must have an :id key" unless id end
Generated with the Darkfish Rdoc Generator 2.