Class: GoogleReviews::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/google_reviews/response.rb

Overview

Response Object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data: [], status: "OK", error: "") ⇒ Response

Returns a new instance of Response.



8
9
10
11
12
# File 'lib/google_reviews/response.rb', line 8

def initialize(data: [], status: "OK", error: "")
  @data = data
  @status = status
  @error = error
end

Instance Attribute Details

#data ⇒ Object (readonly)

Returns the value of attribute data.



6
7
8
# File 'lib/google_reviews/response.rb', line 6

def data
  @data
end

#error ⇒ Object (readonly)

Returns the value of attribute error.



6
7
8
# File 'lib/google_reviews/response.rb', line 6

def error
  @error
end

#status ⇒ Object (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/google_reviews/response.rb', line 6

def status
  @status
end

Instance Method Details

#success? ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/google_reviews/response.rb', line 14

def success?
  status == "OK"
end