Sha256: 337e67636b0a0e2c305411d8950269594f7119c1df07133c5fa44d1558e6e91b

Contents?: true

Size: 722 Bytes

Versions: 10

Compression:

Stored size: 722 Bytes

Contents

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

      def notify_user_url
        "#{Cloudfuji::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
            "#{Cloudfuji::Platform.host}/#{prefix}/#{Cloudfuji::Config.api_version}/#{method_name}"
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cloudfuji-0.0.46 lib/cloudfuji/base.rb
cloudfuji-0.0.45 lib/cloudfuji/base.rb
cloudfuji-0.0.44 lib/cloudfuji/base.rb
cloudfuji-0.0.43 lib/cloudfuji/base.rb
cloudfuji-0.0.42 lib/cloudfuji/base.rb
cloudfuji-0.0.41 lib/cloudfuji/base.rb
cloudfuji-0.0.40 lib/cloudfuji/base.rb
cloudfuji-0.0.39 lib/cloudfuji/base.rb
cloudfuji-0.0.38 lib/cloudfuji/base.rb
cloudfuji-0.0.37 lib/cloudfuji/base.rb