class Google::Business::Reviews::Review

Attributes

author[R]
content[R]
language[R]
rating[R]
relative_time[R]
time[R]

Public Class Methods

new(rev) click to toggle source
# File lib/google/business/reviews/review.rb, line 11
def initialize(rev)
        @author = Google::Business::Reviews::Author.new(rev["author_name"], rev["author_url"], rev["profile_photo_url"])
        @language = rev["language"]
        @rating = rev["rating"]
        @content = rev["text"]
        @time = Time.at(rev["time"])
        @relative_time = rev["relative_time_description"]
end

Public Instance Methods

as_json() click to toggle source
# File lib/google/business/reviews/review.rb, line 24
def as_json
        {
                author: author.to_json,
                language: language,
                rating: rating,
                content: content,
                time: time,
                relative_time: relative_time
        }
end
to_s() click to toggle source
# File lib/google/business/reviews/review.rb, line 20
def to_s
        "#{author.name} wrote #{content} about #{relative_time}"
end