Class: Foursquare::Category

Inherits:
Object
  • Object
show all
Defined in:
lib/foursquare/category.rb

Instance Method Summary collapse

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

#iconObject



21
22
23
# File 'lib/foursquare/category.rb', line 21

def icon
  @json["icon"]
end

#nameObject



13
14
15
# File 'lib/foursquare/category.rb', line 13

def name
  @json["name"]
end

#parentsObject

array



26
27
28
# File 'lib/foursquare/category.rb', line 26

def parents
  @json["parents"]
end

#plural_nameObject



17
18
19
# File 'lib/foursquare/category.rb', line 17

def plural_name
  @json["pluralName"]
end

#primary?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/foursquare/category.rb', line 30

def primary?
  @json["primary"] == true
end