Module: TwicasStream::RequestHeader

Included in:
TwicasStream
Defined in:
lib/twicas_stream/request_header.rb

Constant Summary collapse

REQUEST_HEADER =
[
	:accept_encoding,
	:api_version,
	:access_token
].freeze
DEFAULT_API_VERSION =
'2.0'
DEFAULT_ACCEPT_ENCODING =
'application/json'
DEFAULT_ACCESS_TOKEN =
''

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



20
21
22
# File 'lib/twicas_stream/request_header.rb', line 20

def self.extended(base)
	base.reset
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



24
25
26
# File 'lib/twicas_stream/request_header.rb', line 24

def configure
	yield self
end

#resetObject



28
29
30
31
32
33
# File 'lib/twicas_stream/request_header.rb', line 28

def reset
	self.api_version     = DEFAULT_ACCEPT_ENCODING
	self.accept_encoding = DEFAULT_API_VERSION
	self.access_token    = DEFAULT_ACCESS_TOKEN
	self
end