Class: Vidsy::Data::API::Brand
- Defined in:
- lib/vidsy/data/api/brand.rb
Class Method Summary collapse
Instance Method Summary collapse
- #challenges ⇒ Object
-
#initialize(id = nil) ⇒ Brand
constructor
A new instance of Brand.
Methods inherited from Client
set_api_key, set_endpoint, set_routes, set_version
Constructor Details
#initialize(id = nil) ⇒ Brand
Returns a new instance of Brand.
7 8 9 |
# File 'lib/vidsy/data/api/brand.rb', line 7 def initialize(id = nil) @id = id end |
Class Method Details
.all ⇒ Object
17 18 19 20 |
# File 'lib/vidsy/data/api/brand.rb', line 17 def self.all brands = get "#{routes.brands}" brands.size == 0 ? nil : brands end |
Instance Method Details
#challenges ⇒ Object
11 12 13 14 15 |
# File 'lib/vidsy/data/api/brand.rb', line 11 def challenges raise(ArgumentError, "ID not set for Brand") if id.nil? challenges = get "#{routes.brand}/#{id}/#{routes.challenges}" challenges.size == 0 ? nil : challenges end |