Sha256: 4e13bc2875ae707f489cde6e169568b75cc340cf8a58d83579f4bfefdebdbf5a

Contents?: true

Size: 823 Bytes

Versions: 2

Compression:

Stored size: 823 Bytes

Contents

require 'page_glimpse/exceptions'
require 'page_glimpse/image_parser'
require 'page_glimpse/json_parser'

module PageGlimpse
  
  class API < Relax::Service
    
    defaults do
      parameter :devkey,  :required => true
      parameter :url,     :required => true
    end
    
    endpoint 'http://images.pageglimpse.com/v1' do
      
      action :thumbnail,  :url => '/thumbnails' do
        parameter :size
        parameter :root
        parameter :nothumb
        
        parser ImageParser do
        end
      end
      
      action :queue,      :url => '/thumbnails/request' do
        parser JsonParser do
        end
      end
      
      action :exists?,    :url => '/thumbnails/exists' do
        parameter :size
        
        parser JsonParser do
        end
      end
      
    end
    
  end
  
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
nbibler-page_glimpse-0.0.1 lib/page_glimpse/api.rb
page_glimpse-0.0.1 lib/page_glimpse/api.rb