Class: Providers::Yelp::Business

Inherits:
Object
  • Object
show all
Defined in:
lib/providers/yelp/business.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#addressObject

Returns the value of attribute address.



4
5
6
# File 'lib/providers/yelp/business.rb', line 4

def address
  @address
end

#average_ratingObject

Returns the value of attribute average_rating.



4
5
6
# File 'lib/providers/yelp/business.rb', line 4

def average_rating
  @average_rating
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/providers/yelp/business.rb', line 4

def name
  @name
end

#total_reviewsObject

Returns the value of attribute total_reviews.



4
5
6
# File 'lib/providers/yelp/business.rb', line 4

def total_reviews
  @total_reviews
end

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/providers/yelp/business.rb', line 4

def url
  @url
end

#yelp_idObject

Returns the value of attribute yelp_id.



4
5
6
# File 'lib/providers/yelp/business.rb', line 4

def yelp_id
  @yelp_id
end

Class Method Details

.build_business(node) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/providers/yelp/business.rb', line 6

def self.build_business(node)
  return nil if node.nil? ||
                node["id"].nil? ||
                node["name"].nil? ||
                node["location"].nil? ||
                node["location"].empty? ||
                node["location"]["display_address"].nil?

  new(node)
end