Class: Barge::Response

Inherits:
Hashie::Mash
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/barge/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(faraday_response) ⇒ Response

Returns a new instance of Response.



10
11
12
13
# File 'lib/barge/response.rb', line 10

def initialize(faraday_response)
  @response = faraday_response
  super(faraday_response.body)
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



7
8
9
# File 'lib/barge/response.rb', line 7

def response
  @response
end

Instance Method Details

#last_pageObject



27
28
29
# File 'lib/barge/response.rb', line 27

def last_page
  extract_page(:last)
end

#next_pageObject



23
24
25
# File 'lib/barge/response.rb', line 23

def next_page
  extract_page(:next)
end

#paginated?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/barge/response.rb', line 15

def paginated?
  !(links && links.pages).nil?
end

#prev_pageObject



19
20
21
# File 'lib/barge/response.rb', line 19

def prev_page
  extract_page(:prev)
end