Sha256: e2097864608e37383f4029866663d01f78edde2e8ef23edd57458c6f1e3d952f

Contents?: true

Size: 888 Bytes

Versions: 1

Compression:

Stored size: 888 Bytes

Contents

require_relative "base"

module Mirror
  module Api
    HOST = "https://www.googleapis.com"

    class Request < Mirror::Api::Base
      TIMELINE = "timeline"
      SUBSCRIPTIONS = "subscriptions"
      LOCATIONS = "locations"
      CONTACTS = "contacts"

      def initialize(creds, options={})
        @resource = options[:resource] || TIMELINE
        @id = options[:id]
        @params = options[:params]
        @expected_response = options[:expected_response]
        host = options[:host] || HOST
        super(creds, options[:raise_errors], host, options[:logger])
      end

      def invoke_url
        @invoke_url ||="#{self.host}/mirror/v1/#{@resource}/#{@id ? @id : ''}"
      end

      def params
        @params ||={}
      end

      def ret_val
        Hashie::Mash.new(@data)
      end

      def expected_response
        @expected_response
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mirror-api-0.0.7 lib/mirror-api/request.rb