Class: WCC::Media::Client
- Inherits:
-
API::RestClient
- Object
- API::RestClient
- WCC::Media::Client
- Defined in:
- lib/wcc/media/client.rb,
lib/wcc/media/client/response.rb
Defined Under Namespace
Constant Summary collapse
- PARAMS =
%w[ limit offset order_by sort target ].freeze
- CONFIGURABLE_PARAMS =
PARAMS - %w[ offset ]
- RESOURCES =
{ 'messages' => WCC::Media::Message, 'series' => WCC::Media::Series, 'speakers' => WCC::Media::Speaker, 'tags' => WCC::Media::Tag, 'playlists' => WCC::Media::Playlist }.freeze
Class Attribute Summary collapse
-
.default ⇒ Object
The default client.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(**options) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(**options) ⇒ Client
Returns a new instance of Client.
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/wcc/media/client.rb', line 44 def initialize(**) = { api_url: 'https://media.watermark.org/api/v1/', response_class: Response }.merge!() super(**) RESOURCES.each do |(endpoint, model)| instance_variable_set("@#{endpoint}", Resource.new(self, model, )) end end |
Class Attribute Details
.default ⇒ Object
The default client. Set this in an initializer to change the client used by all the WCC::Media models
16 17 18 |
# File 'lib/wcc/media/client.rb', line 16 def default @default ||= new end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
42 43 44 |
# File 'lib/wcc/media/client.rb', line 42 def end |