Class: Io::Flow::V0::Models::FtpAccount
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::FtpAccount
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
The FTP Account is your username and password to access this FTP server.
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ FtpAccount
constructor
A new instance of FtpAccount.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ FtpAccount
Returns a new instance of FtpAccount.
28958 28959 28960 28961 28962 28963 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28958 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:server, :user], 'FtpAccount') @server = (x = opts.delete(:server); x.is_a?(::Io::Flow::V0::Models::FtpServer) ? x : ::Io::Flow::V0::Models::FtpServer.new(x)) @user = (x = opts.delete(:user); x.is_a?(::Io::Flow::V0::Models::FtpUser) ? x : ::Io::Flow::V0::Models::FtpUser.new(x)) end |
Instance Attribute Details
#server ⇒ Object (readonly)
Returns the value of attribute server.
28956 28957 28958 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28956 def server @server end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
28956 28957 28958 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28956 def user @user end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
28969 28970 28971 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28969 def copy(incoming={}) FtpAccount.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
28973 28974 28975 28976 28977 28978 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28973 def to_hash { :server => server.to_hash, :user => user.to_hash } end |
#to_json ⇒ Object
28965 28966 28967 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28965 def to_json JSON.dump(to_hash) end |