Sha256: 1d0d2e12281d8f4a402c579deccf5c737de19ff0d63b4abf0658834f79a5c0b2
Contents?: true
Size: 1007 Bytes
Versions: 12
Compression:
Stored size: 1007 Bytes
Contents
require 'active_support/dependencies' require 'agilib/push_notification/platforms/ios' require 'agilib/push_notification/platforms/android' require 'agilib/push_notification/model' module Agilib module PushNotification extend ActiveSupport::Concern @@avaiable_platforms = { :ios => Agilib::PushNotification::Platform::Ios, :android => Agilib::PushNotification::Platform::Android } def self.avaiable_platforms @@avaiable_platforms end mattr_accessor :device_route @@device_route = "/devices" mattr_accessor :use_platforms @@use_platforms = Hash.new def self.platform(name, options={}, &block) @@use_platforms[name] = true mod = @@avaiable_platforms[name] options.each_with_index do |value, index| mod.send("#{value[0]}=", [value[1]]) end if block_given? yield(mod) end end end end if defined? ActiveRecord ActiveRecord::Base.send :include, Agilib::PushNotification end
Version data entries
12 entries across 12 versions & 1 rubygems