Sha256: 367757f4789f626fdf27b21c9aed1ff6b900150999db501ffa07b81704049f9a

Contents?: true

Size: 714 Bytes

Versions: 1

Compression:

Stored size: 714 Bytes

Contents

module Bushido
  class Base
    class << self
      url_pairs = {
                    :unity=>[:valid, :exists, :invite, :pending_invites, :remove, :notify],
                    :email=>[:send, :allowed]
                  }

      def notify_user_url
        "#{Bushido::Platform.host}/notifications.json"
      end

      # NOTE Cannot use define_singleton_method since ruby 1.8 compatibility is a must
      url_pairs.each_pair do |prefix, method_names|
        method_names.each do |method_name|
          define_method "#{method_name}_#{prefix}_url".to_sym do
            "#{Bushido::Platform.host}/#{prefix}/#{Bushido::Config.api_version}/#{method_name}"
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bushido-0.0.36 lib/bushido/base.rb