Module: Rubypress::Media
- Included in:
- Client
- Defined in:
- lib/rubypress/media.rb
Instance Method Summary collapse
- #getMediaItem(options = {}) ⇒ Object
- #getMediaLibrary(options = {}) ⇒ Object
- #uploadFile(options = {}) ⇒ Object
Instance Method Details
#getMediaItem(options = {}) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/rubypress/media.rb', line 5 def getMediaItem( = {}) = { :attachment_id => nil }.deep_merge!() execute('getMediaItem', ) end |
#getMediaLibrary(options = {}) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/rubypress/media.rb', line 12 def getMediaLibrary( = {}) = { :filter => {} }.deep_merge!() execute('getMediaLibrary', ) end |
#uploadFile(options = {}) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/rubypress/media.rb', line 19 def uploadFile( = {}) = { :data => {} }.deep_merge!() [:data][:bits] = XMLRPC::Base64.new(File.read(.delete(:filename))) if .include?(:filename) and File.readable?([:filename]) execute('uploadFile', ) end |