Module: Hexabat::PageRequestBuilder

Defined in:
lib/hexabat/page_request_builder.rb

Defined Under Namespace

Classes: Base, TokenAuthorized, Unauthorized

Class Method Summary collapse

Class Method Details

.for(repository, response_processor, params = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/hexabat/page_request_builder.rb', line 8

def self.for(repository, response_processor, params = {})
  if params.has_key? :token
    TokenAuthorized.new(repository, params[:token], response_processor)
  elsif params.has_key? :oauth
    raise 'OAuth not supported yet'
  else
    Unauthorized.new(repository, response_processor)
  end
end