Sha256: b20fd48c9858e902708b48ed6d5078bd1cb853b390d07f4a77af77080d3445cd
Contents?: true
Size: 628 Bytes
Versions: 138
Compression:
Stored size: 628 Bytes
Contents
module Facebooker class Notifications include Model attr_accessor :messages, :group_invites, :pokes, :friend_requests, :event_invites, :shares [:Messages, :Pokes, :Shares].each do |notification_type| const_set(notification_type, Class.new do include Model attr_accessor :unread, :most_recent end) attribute_name = "#{notification_type.to_s.downcase}" define_method("#{attribute_name}=") do |value| instance_variable_set("@#{attribute_name}", value.kind_of?(Hash) ? Notifications.const_get(notification_type).from_hash(value) : value) end end end end
Version data entries
138 entries across 138 versions & 30 rubygems