Sha256: 5b9b14138a2ee8625dd949f1b6f5aa5304578e129510ee301ea933dd2d44dac2

Contents?: true

Size: 1.91 KB

Versions: 4

Compression:

Stored size: 1.91 KB

Contents

# Copyright 2014-2015 Taxamo, Ltd.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

class CreatePaymentIn
  attr_accessor :amount, :payment_timestamp, :payment_information

  # :internal => :external
  def self.attribute_map
    {
      :amount => :amount,
      :payment_timestamp => :payment_timestamp,
      :payment_information => :payment_information

    }
  end

  def initialize(attributes = {})
    return if attributes.empty?
    # Morph attribute keys into undescored rubyish style
    if attributes["amount"]
      @amount = attributes["amount"]
        
    end
    if attributes["payment_timestamp"]
      @payment_timestamp = attributes["payment_timestamp"]
        
    end
    if attributes["payment_information"]
      @payment_information = attributes["payment_information"]
        
    end
    

  end

  def to_body
    body = {}
    self.class.attribute_map.each_pair do |key, value|
      v = self.send(key)
      unless v.nil?
        if v.is_a?(Array)
          array = Array.new
          v.each do |item|
            if item.respond_to?("to_body".to_sym)
              array.push item.to_body
            else
              array.push item
            end
          end
          body[value] = array
        else
          if v.respond_to?("to_body".to_sym)
            body[value] = v.to_body
          else
            body[value] = v
          end
        end
      end
    end
    body
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
taxamo-1.1.1 lib/taxamo/models/createpaymentin.rb
taxamo-1.1.0 lib/taxamo/models/createpaymentin.rb
taxamo-1.0.6.1 lib/taxamo/models/createpaymentin.rb
taxamo-1.0.5 lib/taxamo/models/createpaymentin.rb