Class: Mushikago::Hotaru::Request

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

Overview

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

Instance Attribute Summary

Attributes inherited from Mushikago::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 Mushikago::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('hotaru.mushikago.org') (String)

    Hotaruのエンドポイント



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

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