Module: Kaltura::ClientResource
- Included in:
- MediaEntry, Session
- Defined in:
- lib/kaltura/client_resource.rb
Instance Method Summary collapse
- #fetch(service, action, options = {}) ⇒ Object
- #post(service, action, options = {}) ⇒ Object
- #url ⇒ Object
Instance Method Details
#fetch(service, action, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/kaltura/client_resource.rb', line 4 def fetch(service, action, = {}) _kickstart_session! response = HTTParty.get(url, :query => (service, action, ), :format => :xml) _verify_http_code!(response, 200) { raise FetchError, "Fetch failed, HTTP error: #{response.code}" } mashes = _mashes_from_response(response) return_mash = mashes.map { |m| new(m) } _verify_kaltura_error!(return_mash) end |
#post(service, action, options = {}) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/kaltura/client_resource.rb', line 17 def post(service, action, = {}) [:service] = service [:action] = action response = HTTParty.post(url, :body => , :format => :xml) _verify!(response, 201) { raise CreateError, "Create failed, HTTP error: #{response.code}" } end |