Class: Rallio::Review

Inherits:
Base
  • Object
show all
Defined in:
lib/rallio/review.rb

Overview

Represents a review object as it comes from Rallio.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

app_credentials

Instance Attribute Details

#account_idInteger

Returns unique id for account.

Returns:

  • (Integer)

    unique id for account


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#account_nameString

Returns account name.

Returns:

  • (String)

    account name


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#can_replytrue, false

Returns true if review can be replied to.

Returns:

  • (true, false)

    true if review can be replied to


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#commentsArray<Hash>

Returns for facebook this is an array of responses to review.

Returns:

  • (Array<Hash>)

    for facebook this is an array of responses to review


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#idInteger

Returns unique id for review.

Returns:

  • (Integer)

    unique id for review


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#likedtrue, false

Returns true if review has been liked.

Returns:

  • (true, false)

    true if review has been liked


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#location_image_urlString

Returns url for image of location.

Returns:

  • (String)

    url for image of location


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#location_nameString

Returns location review is for.

Returns:

  • (String)

    location review is for


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#messageString

Returns review text left by reviewer.

Returns:

  • (String)

    review text left by reviewer


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#networkString

Returns social network review was posted to.

Returns:

  • (String)

    social network review was posted to


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#posted_atDateTime

Returns DateTime review was made.

Returns:

  • (DateTime)

    DateTime review was made


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#ratingInteger

Returns overall review rating.

Returns:

  • (Integer)

    overall review rating


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#review_replyString

Returns reply for non-facebook reviews.

Returns:

  • (String)

    reply for non-facebook reviews


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#review_reply_atDateTime

Returns DateTime of reply for non-facebook reviews.

Returns:

  • (DateTime)

    DateTime of reply for non-facebook reviews


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#urlString

Returns url to review.

Returns:

  • (String)

    url to review


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#user_imageString

Returns link to image of reviewer.

Returns:

  • (String)

    link to image of reviewer


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

#user_nameString

Returns social network username of reviewer.

Returns:

  • (String)

    social network username of reviewer


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/rallio/review.rb', line 38

class Review < Base
  attribute :id, Integer
  attribute :account_id, Integer
  attribute :account_name, String
  attribute :network, String
  attribute :posted_at, DateTime
  attribute :user_name, String
  attribute :user_image, String
  attribute :rating, Float
  attribute :message, String
  attribute :comments, Array[Hash]
  attribute :liked, Axiom::Types::Boolean
  attribute :url, String
  attribute :can_reply, Axiom::Types::Boolean
  attribute :location_name, String
  attribute :location_image_url, String
  attribute :review_reply, String
  attribute :review_reply_at, DateTime

  # Retreives reviews. All query_params are optional. If no query_params are
  # passed in all reviews accessible to user are returned.
  #
  # @param query_params [Hash] params to filter results
  # @option query_params [String] :page results page
  # @option query_params [String] :account_id filter results to one or more
  #   accounts, should be seperated by commas
  # @option query_params [String] :franchisor_id filter results to a single
  #   franchisor
  # @option query_params [String] :network filter results to one network,
  #   possible choices are facebook, google_places, yelp
  # @option query_params [String] :start_date iso8601 date to start on
  # @option query_params [String] :end_date iso8601 date to end on
  # @option query_params [String] :rating filter by rating
  # @param access_token [String] user access token to use for authorization
  # @return [Array<Rallio::Review>]
  def self.all(query_params: {}, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    response = self.get("/reviews", query: query_params, headers: headers)
    response.parsed_response['reviews'].map { |r| new(r) }
  end

  # Replies to review.
  #
  # @param message [String] text used for reply
  # @param access_token [String] user access token to use for authorization
  # @return [Hash] reply hash that was created
  def reply(message:, access_token:)
    headers = { 'Authorization' => "Bearer #{access_token}" }
    self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
  end
end

Class Method Details

.all(query_params: {}, access_token:) ⇒ Array<Rallio::Review>

Retreives reviews. All query_params are optional. If no query_params are passed in all reviews accessible to user are returned.

Parameters:

  • query_params (Hash) (defaults to: {})

    params to filter results

  • access_token (String)

    user access token to use for authorization

Options Hash (query_params:):

  • :page (String)

    results page

  • :account_id (String)

    filter results to one or more accounts, should be seperated by commas

  • :franchisor_id (String)

    filter results to a single franchisor

  • :network (String)

    filter results to one network, possible choices are facebook, google_places, yelp

  • :start_date (String)

    iso8601 date to start on

  • :end_date (String)

    iso8601 date to end on

  • :rating (String)

    filter by rating

Returns:


73
74
75
76
77
# File 'lib/rallio/review.rb', line 73

def self.all(query_params: {}, access_token:)
  headers = { 'Authorization' => "Bearer #{access_token}" }
  response = self.get("/reviews", query: query_params, headers: headers)
  response.parsed_response['reviews'].map { |r| new(r) }
end

Instance Method Details

#reply(message:, access_token:) ⇒ Hash

Replies to review.

Parameters:

  • message (String)

    text used for reply

  • access_token (String)

    user access token to use for authorization

Returns:

  • (Hash)

    reply hash that was created


84
85
86
87
# File 'lib/rallio/review.rb', line 84

def reply(message:, access_token:)
  headers = { 'Authorization' => "Bearer #{access_token}" }
  self.class.post("/reviews/#{id}/reply", headers: headers, body: { message: message })
end