Class: Io::Flow::V0::Models::FtpFileForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Create a file that will be uploaded to this organization’s FTP Server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ FtpFileForm

Returns a new instance of FtpFileForm.



38628
38629
38630
38631
38632
38633
38634
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38628

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:url, :directory], 'FtpFileForm')
  @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String)
  @directory = HttpClient::Preconditions.assert_class('directory', opts.delete(:directory), String)
  @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String))
end

Instance Attribute Details

#directoryObject (readonly)

Returns the value of attribute directory.



38626
38627
38628
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38626

def directory
  @directory
end

#nameObject (readonly)

Returns the value of attribute name.



38626
38627
38628
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38626

def name
  @name
end

#urlObject (readonly)

Returns the value of attribute url.



38626
38627
38628
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38626

def url
  @url
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



38640
38641
38642
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38640

def copy(incoming={})
  FtpFileForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



38644
38645
38646
38647
38648
38649
38650
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38644

def to_hash
  {
    :url => url,
    :directory => directory,
    :name => name
  }
end

#to_jsonObject



38636
38637
38638
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38636

def to_json
  JSON.dump(to_hash)
end