Class: Io::Flow::V0::Models::CustomerReference

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ CustomerReference



27086
27087
27088
27089
27090
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27086

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:number], 'CustomerReference')
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



27084
27085
27086
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27084

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



27096
27097
27098
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27096

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

#to_hashObject



27100
27101
27102
27103
27104
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27100

def to_hash
  {
    :number => number
  }
end

#to_jsonObject



27092
27093
27094
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27092

def to_json
  JSON.dump(to_hash)
end