Class: Io::Flow::V0::Models::OrderNumberGeneratorUuid
- Inherits:
-
OrderNumberGenerator
- Object
- OrderNumberGenerator
- Io::Flow::V0::Models::OrderNumberGeneratorUuid
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Generates an order number based on a UUID (no dashes or other formatting). This is the default for Flow orders (with order number prefixed by ord-)
Instance Attribute Summary collapse
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Attributes inherited from OrderNumberGenerator
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderNumberGeneratorUuid
constructor
A new instance of OrderNumberGeneratorUuid.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from OrderNumberGenerator
Constructor Details
#initialize(incoming = {}) ⇒ OrderNumberGeneratorUuid
Returns a new instance of OrderNumberGeneratorUuid.
52529 52530 52531 52532 52533 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52529 def initialize(incoming={}) super(:discriminator => OrderNumberGenerator::Types::ORDER_NUMBER_GENERATOR_UUID) opts = HttpClient::Helper.symbolize_keys(incoming) @prefix = HttpClient::Preconditions.assert_class('prefix', (x = opts.delete(:prefix); x.nil? ? "ord-" : x), String) end |
Instance Attribute Details
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
52527 52528 52529 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52527 def prefix @prefix end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
52539 52540 52541 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52539 def copy(incoming={}) OrderNumberGeneratorUuid.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
52543 52544 52545 52546 52547 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52543 def subtype_to_hash { :prefix => prefix } end |
#to_json ⇒ Object
52535 52536 52537 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52535 def to_json JSON.dump(to_hash) end |