Class: Io::Flow::V0::Models::Attachment
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::Attachment
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ Attachment
constructor
A new instance of Attachment.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ Attachment
Returns a new instance of Attachment.
30668 30669 30670 30671 30672 30673 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30668 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:type, :url], 'Attachment') @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::StatementAttachmentType) ? x : ::Io::Flow::V0::Models::StatementAttachmentType.apply(x)) @url = HttpClient::Preconditions.assert_class('url', opts.delete(:url), String) end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
30666 30667 30668 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30666 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
30666 30667 30668 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30666 def url @url end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30679 30680 30681 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30679 def copy(incoming={}) Attachment.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
30683 30684 30685 30686 30687 30688 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30683 def to_hash { :type => type.value, :url => url } end |
#to_json ⇒ Object
30675 30676 30677 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30675 def to_json JSON.dump(to_hash) end |