Module: Wes::Data::API::Base
- Included in:
- Billing, Brand, BrandUser, Challenge, Collective, CreatorUser, Reward, Submission, Video, VideoTranscodingState
- Defined in:
- lib/wes/data/api/base.rb
Instance Method Summary collapse
- #add_state(route, state = nil) ⇒ Object
- #client ⇒ Object
- #configuration ⇒ Object
- #map_objects(records, klass) ⇒ Object
- #routes ⇒ Object
Instance Method Details
#add_state(route, state = nil) ⇒ Object
8 9 10 11 |
# File 'lib/wes/data/api/base.rb', line 8 def add_state(route, state = nil) return route unless state "#{route}/#{state}" end |
#client ⇒ Object
13 14 15 |
# File 'lib/wes/data/api/base.rb', line 13 def client Client.new end |
#configuration ⇒ Object
17 18 19 |
# File 'lib/wes/data/api/base.rb', line 17 def configuration Configuration end |
#map_objects(records, klass) ⇒ Object
21 22 23 |
# File 'lib/wes/data/api/base.rb', line 21 def map_objects(records, klass) records.map { |r| klass.new(r) } end |
#routes ⇒ Object
25 26 27 |
# File 'lib/wes/data/api/base.rb', line 25 def routes configuration.routes end |