Class: StudioApi::Rpm
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- StudioApi::Rpm
- Extended by:
- StudioResource
- Defined in:
- lib/studio_api/rpm.rb
Overview
Represents Additional rpms which can user upload to studio.
Allows uploading, downloading, listing (via find) and deleting
Class Method Summary collapse
-
.upload(content, base_system) ⇒ StudioApi::Rpm
Upload file to studio account (user repository).
Instance Method Summary collapse
-
#content ⇒ String
Downloads file to specified path.
Methods included from StudioResource
collection_path, element_path, extended, studio_connection, studio_connection=
Class Method Details
.upload(content, base_system) ⇒ StudioApi::Rpm
Upload file to studio account (user repository)
22 23 24 25 26 27 28 29 |
# File 'lib/studio_api/rpm.rb', line 22 def self.upload content, base_system response = GenericRequest.new(studio_connection).post "/rpms?base_system=#{CGI.escape base_system.to_s}", :file => content if defined? ActiveModel #for rails3 we need persistent, otherwise delete method fail self.new Hash.from_xml(response)["rpm"],true else self.new Hash.from_xml(response)["rpm"] end end |
Instance Method Details
#content ⇒ String
Downloads file to specified path.
33 34 35 |
# File 'lib/studio_api/rpm.rb', line 33 def content GenericRequest.new(self.class.studio_connection).get "/rpms/#{id.to_i}/data" end |