Class: Mushikago::Mitsubachi::Request

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

Overview

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

Direct Known Subclasses

HttpFetchRequest, HttpPushRequest, ProjectCreateRequest, ProjectDeleteRequest, ProjectDiscontinueRequest, ProjectInfoRequest, ProjectListRequest, ProjectQueuesRequest, ProjectUpdateRequest, ResourceDeleteRequest, ResourceGetRequest, ResourceListRequest, ScriptDeleteRequest, ScriptGetRequest, ScriptListRequest

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('api.mushikago.org') (String)

    Mitsubachiのエンドポイント



10
11
12
13
14
15
16
17
# File 'lib/mushikago/mitsubachi/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}/mitsubachi/#{method_name}"
end