class GoodDataMarketo::Loads
Attributes
available[RW]
Public Class Methods
new(config = {})
click to toggle source
# File lib/gooddata_marketo/loads.rb, line 13 def initialize config = {} @user = config[:user] @password = config[:pass] || config[:password] @project = config[:project] || config[:pid] @client = config[:marketo_client] || config[:marketo] @webdav = WebDAV.new :user => @user, :password => @password, :project => @project end
Public Instance Methods
available?()
click to toggle source
# File lib/gooddata_marketo/loads.rb, line 35 def available? loads = Dir.entries('.').select { |f| f.include? '_load.json' } if loads.empty? false else true self.available = loads end end
download_from_webdav(file)
click to toggle source
# File lib/gooddata_marketo/loads.rb, line 50 def download_from_webdav file raise 'You must specify a :user, :password; and :project from GoodData.' unless @webdav @webdav.download file end
instantiate(config = {})
click to toggle source
# File lib/gooddata_marketo/loads.rb, line 23 def instantiate config = {} config[:webdav] = @webdav config[:client] = @client Load.new config end
Also aliased as: create
open(file)
click to toggle source
# File lib/gooddata_marketo/loads.rb, line 31 def open file Load.new :file => file, :client => @client, :webdav => @webdav end
upload_to_webdav(file)
click to toggle source
# File lib/gooddata_marketo/loads.rb, line 45 def upload_to_webdav file raise 'You must specify a :user, :password; and :project from GoodData.' unless @webdav @webdav.upload file end