class Io::Flow::V0::Models::OrderNumberGeneratorPrefixSuffix

Generator with an optional prefix, followed by an integer and an optional suffix

Attributes

fixed_length[R]
prefix[R]
starts_with[R]
suffix[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 52495
def initialize(incoming={})
  super(:discriminator => OrderNumberGenerator::Types::ORDER_NUMBER_GENERATOR_PREFIX_SUFFIX)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @prefix = (x = opts.delete(:prefix); x.nil? ? nil : HttpClient::Preconditions.assert_class('prefix', x, String))
  @starts_with = (x = opts.delete(:starts_with); x.nil? ? nil : HttpClient::Preconditions.assert_class('starts_with', x, Integer))
  @suffix = (x = opts.delete(:suffix); x.nil? ? nil : HttpClient::Preconditions.assert_class('suffix', x, String))
  @fixed_length = (x = opts.delete(:fixed_length); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::OrderNumberGeneratorFixedLength) ? x : ::Io::Flow::V0::Models::OrderNumberGeneratorFixedLength.new(x)))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 52508
def copy(incoming={})
  OrderNumberGeneratorPrefixSuffix.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 52512
def subtype_to_hash
  {
    :prefix => prefix,
    :starts_with => starts_with,
    :suffix => suffix,
    :fixed_length => fixed_length.nil? ? nil : fixed_length.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 52504
def to_json
  JSON.dump(to_hash)
end