Class: MySociety::MapIt::LocalAuthority
- Inherits:
-
Object
- Object
- MySociety::MapIt::LocalAuthority
- Defined in:
- lib/my_society/map_it.rb
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(attributes) ⇒ LocalAuthority
constructor
A new instance of LocalAuthority.
- #name ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(attributes) ⇒ LocalAuthority
Returns a new instance of LocalAuthority.
50 51 52 |
# File 'lib/my_society/map_it.rb', line 50 def initialize attributes self.attributes = attributes end |
Class Method Details
.find(uri) ⇒ Object
44 45 46 47 48 |
# File 'lib/my_society/map_it.rb', line 44 def self.find uri u = URI.parse uri r = Net::HTTP.get_response u new JSON.parse r.body end |
Instance Method Details
#id ⇒ Object
58 59 60 |
# File 'lib/my_society/map_it.rb', line 58 def id attributes['id'] end |
#name ⇒ Object
54 55 56 |
# File 'lib/my_society/map_it.rb', line 54 def name attributes['name'] end |