Class: Mushikago::Tombo::Request

Inherits:
Http::Request show all
Includes:
Auth::Signature
Defined in:
lib/mushikago/tombo/request.rb

Overview

Tomboのリクエストを表す抽象クラス

Direct Known Subclasses

CaptureRequest, CapturesRequest, DeleteRequest, InfoRequest

Instance Attribute Summary

Attributes inherited from Http::Request

headers, host, http_method, params, path, port

Instance Method Summary (collapse)

Methods included from Auth::Signature

#add_signature!, #string_to_sign

Methods inherited from Http::Request

#[], #[]=, add_param, #to_http_request, #url_encoded_params

Constructor Details

- (Request) initialize(options = {})

A new instance of Request

Parameters:

  • options (Hash) (defaults to: {})

    オプション

Options Hash (options):

  • :endpoint('tombo.mushikago.org') (String)

    Tomboのエンドポイント



10
11
12
13
14
15
16
17
# File 'lib/mushikago/tombo/request.rb', line 10

def initialize options={}
  super()
  endpoint = options[:endpoint] || Mushikago.config.endpoint
  host, port = endpoint.split(':')
  @host = host
  @port = port if port
  @path = "/#{api_version}/tombo/#{method_name}"
end