Class: BitBucket::Response::Header
- Inherits:
-
Struct
- Object
- Struct
- BitBucket::Response::Header
show all
- Includes:
- Constants
- Defined in:
- lib/bitbucket_rest_api/response/header.rb
Overview
Represents http response header
Constant Summary
collapse
- SUCCESSFUL_STATUSES =
200..299
Constants included
from Constants
Constants::ACCEPT, Constants::ACCEPT_CHARSET, Constants::CACHE_CONTROL, Constants::CONTENT_LENGTH, Constants::CONTENT_TYPE, Constants::DATE, Constants::ETAG, Constants::LOCATION, Constants::META_FIRST, Constants::META_LAST, Constants::META_NEXT, Constants::META_PREV, Constants::META_REL, Constants::PARAM_PAGE, Constants::PARAM_START_PAGE, Constants::QUERY_STR_SEP, Constants::RATELIMIT_LIMIT, Constants::RATELIMIT_REMAINING, Constants::SERVER, Constants::USER_AGENT
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env
7
8
9
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 7
def env
@env
end
|
Instance Method Details
#body ⇒ Object
62
63
64
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 62
def body
loaded? ? env[:body] : nil
end
|
#cache_control ⇒ Object
25
26
27
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 25
def cache_control
loaded? ? env[:response_headers][CACHE_CONTROL] : nil
end
|
#content_length ⇒ Object
33
34
35
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 33
def content_length
loaded? ? env[:response_headers][CONTENT_LENGTH] : nil
end
|
#content_type ⇒ Object
29
30
31
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 29
def content_type
loaded? ? env[:response_headers][CONTENT_TYPE] : nil
end
|
#date ⇒ Object
41
42
43
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 41
def date
loaded? ? env[:response_headers][DATE] : nil
end
|
#etag ⇒ Object
37
38
39
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 37
def etag
loaded? ? env[:response_headers][ETAG] : nil
end
|
#loaded? ⇒ Boolean
12
13
14
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 12
def loaded?
!!env
end
|
#location ⇒ Object
45
46
47
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 45
def location
loaded? ? env[:response_headers][LOCATION] : nil
end
|
#ratelimit_limit ⇒ Object
Requests are limited to API v3 to 5000 per hour.
17
18
19
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 17
def ratelimit_limit
loaded? ? env[:response_headers][RATELIMIT_LIMIT] : nil
end
|
#ratelimit_remaining ⇒ Object
21
22
23
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 21
def ratelimit_remaining
loaded? ? env[:response_headers][RATELIMIT_REMAINING] : nil
end
|
#server ⇒ Object
49
50
51
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 49
def server
loaded? ? env[:response_headers][SERVER] : nil
end
|
#status ⇒ Object
53
54
55
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 53
def status
loaded? ? env[:status] : nil
end
|
#success? ⇒ Boolean
57
58
59
|
# File 'lib/bitbucket_rest_api/response/header.rb', line 57
def success?
SUCCESSFUL_STATUSES.include? status
end
|