Class: Google::APIClient::MediaUpload
- Inherits:
-
Object
- Object
- Google::APIClient::MediaUpload
- Defined in:
- lib/google/api_client/discovery/media.rb
Overview
Media upload elements for discovered methods
Instance Method Summary collapse
-
#accepted_types ⇒ Array
List of acceptable mime types.
-
#initialize(api, method_base, discovery_document) ⇒ Google::APIClient::Method
constructor
Creates a description of a particular method.
-
#max_size ⇒ String
Maximum size of an uplad TODO: Parse & convert to numeric value.
-
#uri_template ⇒ Addressable::Template
Returns the URI template for the method.
Constructor Details
#initialize(api, method_base, discovery_document) ⇒ Google::APIClient::Method
Creates a description of a particular method.
39 40 41 42 43 |
# File 'lib/google/api_client/discovery/media.rb', line 39 def initialize(api, method_base, discovery_document) @api = api @method_base = method_base @discovery_document = discovery_document end |
Instance Method Details
#accepted_types ⇒ Array
List of acceptable mime types
50 51 52 |
# File 'lib/google/api_client/discovery/media.rb', line 50 def accepted_types @discovery_document['accept'] end |
#max_size ⇒ String
Maximum size of an uplad TODO: Parse & convert to numeric value
59 60 61 |
# File 'lib/google/api_client/discovery/media.rb', line 59 def max_size @discovery_document['maxSize'] end |
#uri_template ⇒ Addressable::Template
Returns the URI template for the method. A parameter list can be used to expand this into a URI.
68 69 70 71 72 |
# File 'lib/google/api_client/discovery/media.rb', line 68 def uri_template return @uri_template ||= Addressable::Template.new( @api.method_base.join(Addressable::URI.parse(@discovery_document['protocols']['simple']['path'])) ) end |