Class: Foursquare::Category
- Inherits:
-
Object
- Object
- Foursquare::Category
- Defined in:
- lib/foursquare/category.rb
Instance Method Summary collapse
-
#[](key) ⇒ Object
this enabled the previous app to work with this new version where Category is now an object.
- #icon ⇒ Object
-
#initialize(json) ⇒ Category
constructor
A new instance of Category.
- #name ⇒ Object
-
#parents ⇒ Object
array.
- #plural_name ⇒ Object
- #primary? ⇒ Boolean
Constructor Details
#initialize(json) ⇒ Category
Returns a new instance of Category.
9 10 11 |
# File 'lib/foursquare/category.rb', line 9 def initialize(json) @json = json end |
Instance Method Details
#[](key) ⇒ Object
this enabled the previous app to work with this new version where Category is now an object
5 6 7 |
# File 'lib/foursquare/category.rb', line 5 def [](key) @json[key] end |
#icon ⇒ Object
21 22 23 |
# File 'lib/foursquare/category.rb', line 21 def icon @json["icon"] end |
#name ⇒ Object
13 14 15 |
# File 'lib/foursquare/category.rb', line 13 def name @json["name"] end |
#parents ⇒ Object
array
26 27 28 |
# File 'lib/foursquare/category.rb', line 26 def parents @json["parents"] end |
#plural_name ⇒ Object
17 18 19 |
# File 'lib/foursquare/category.rb', line 17 def plural_name @json["pluralName"] end |
#primary? ⇒ Boolean
30 31 32 |
# File 'lib/foursquare/category.rb', line 30 def primary? @json["primary"] == true end |