Sha256: 83d57c5f9dbda2e53eda41671ce8f9896db9e7fcb6755fd342977834c015da5d

Contents?: true

Size: 1.96 KB

Versions: 14

Compression:

Stored size: 1.96 KB

Contents

module GeoCerts
  module Endpoints # :nodoc:
    
    module Events # :nodoc:
      
      def self.included(base)
        base.class_eval do
          endpoint GeoCerts::API::ENDPOINT do
            
            action :events, :url => '/events.xml' do
              parameter :start_at
              parameter :end_at
              
              parser Parsers::OrderParser do
                element :events do
                  attribute 'start_at',             :as => :start_at,           :type => DateTime
                  attribute 'end_at',               :as => :end_at,             :type => DateTime
                  
                  elements :event do
                    element 'event-id',             :as => :id,                 :type => Integer
                    element 'order-id',             :as => :order_id
                    element :name
                    element 'created-at',           :as => :created_at,         :type => DateTime
                  end
                end
              end
            end
            
            action :order_events, :url => '/orders/:order_id/events.xml' do
              parameter :start_at
              parameter :end_at
              
              parser Parsers::OrderParser do
                element :events do
                  attribute 'start_at',             :as => :start_at,           :type => DateTime
                  attribute 'end_at',               :as => :end_at,             :type => DateTime
                  
                  elements :event do
                    element 'event-id',             :as => :id,                 :type => Integer
                    element 'order-id',             :as => :order_id
                    element :name
                    element 'created-at',           :as => :created_at,         :type => DateTime
                  end
                end
              end
            end
            
            
          end
        end
      end
      
    end
    
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
geocerts-1.0.1 lib/geo_certs/endpoints/events.rb
geocerts-1.0.0 lib/geo_certs/endpoints/events.rb
geocerts-0.0.25 lib/geo_certs/endpoints/events.rb
geocerts-0.0.24 lib/geo_certs/endpoints/events.rb
geocerts-0.0.23 lib/geo_certs/endpoints/events.rb
geocerts-0.0.22 lib/geo_certs/endpoints/events.rb
geocerts-0.0.21 lib/geo_certs/endpoints/events.rb
geocerts-0.0.20 lib/geo_certs/endpoints/events.rb
geocerts-0.0.19 lib/geo_certs/endpoints/events.rb
geocerts-0.0.18 lib/geo_certs/endpoints/events.rb
geocerts-0.0.17 lib/geo_certs/endpoints/events.rb
geocerts-0.0.16 lib/geo_certs/endpoints/events.rb
geocerts-0.0.15 lib/geo_certs/endpoints/events.rb
geocerts-0.0.14 lib/geo_certs/endpoints/events.rb