Class: WalkscoreApi::Walkscore
- Inherits:
-
Object
- Object
- WalkscoreApi::Walkscore
- Defined in:
- lib/walkscore/walkscore.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#logo_url ⇒ Object
Returns the value of attribute logo_url.
-
#score ⇒ Object
Returns the value of attribute score.
-
#updated ⇒ Object
Returns the value of attribute updated.
-
#ws_link ⇒ Object
Returns the value of attribute ws_link.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Walkscore
constructor
A new instance of Walkscore.
Constructor Details
#initialize(attributes) ⇒ Walkscore
Returns a new instance of Walkscore.
7 8 9 10 11 12 13 |
# File 'lib/walkscore/walkscore.rb', line 7 def initialize(attributes) self.score = attributes['walkscore'] self.description = attributes['description'] self.updated = attributes['updated'] self.logo_url = attributes['logo_url'] self.ws_link = attributes['ws_link'] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/walkscore/walkscore.rb', line 5 def description @description end |
#logo_url ⇒ Object
Returns the value of attribute logo_url.
5 6 7 |
# File 'lib/walkscore/walkscore.rb', line 5 def logo_url @logo_url end |
#score ⇒ Object
Returns the value of attribute score.
5 6 7 |
# File 'lib/walkscore/walkscore.rb', line 5 def score @score end |
#updated ⇒ Object
Returns the value of attribute updated.
5 6 7 |
# File 'lib/walkscore/walkscore.rb', line 5 def updated @updated end |
#ws_link ⇒ Object
Returns the value of attribute ws_link.
5 6 7 |
# File 'lib/walkscore/walkscore.rb', line 5 def ws_link @ws_link end |
Class Method Details
.client ⇒ Object
15 16 17 |
# File 'lib/walkscore/walkscore.rb', line 15 def self.client WalkscoreApi::Client.new end |
.find(location, api_key) ⇒ Object
19 20 21 22 |
# File 'lib/walkscore/walkscore.rb', line 19 def self.find(location, api_key) parsed_results = JSON.parse(client.make_connection(location, api_key)) WalkscoreApi::Walkscore.new(parsed_results) end |