Class: Io::Flow::V0::Models::OrderNumberGeneratorPrefixSuffix
- Inherits:
-
OrderNumberGenerator
- Object
- OrderNumberGenerator
- Io::Flow::V0::Models::OrderNumberGeneratorPrefixSuffix
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Generator with an optional prefix, followed by an integer and an optional suffix
Instance Attribute Summary collapse
-
#fixed_length ⇒ Object
readonly
Returns the value of attribute fixed_length.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#starts_with ⇒ Object
readonly
Returns the value of attribute starts_with.
-
#suffix ⇒ Object
readonly
Returns the value of attribute suffix.
Attributes inherited from OrderNumberGenerator
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderNumberGeneratorPrefixSuffix
constructor
A new instance of OrderNumberGeneratorPrefixSuffix.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from OrderNumberGenerator
Constructor Details
#initialize(incoming = {}) ⇒ OrderNumberGeneratorPrefixSuffix
Returns a new instance of OrderNumberGeneratorPrefixSuffix.
36268 36269 36270 36271 36272 36273 36274 36275 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36268 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 |
Instance Attribute Details
#fixed_length ⇒ Object (readonly)
Returns the value of attribute fixed_length.
36266 36267 36268 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36266 def fixed_length @fixed_length end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
36266 36267 36268 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36266 def prefix @prefix end |
#starts_with ⇒ Object (readonly)
Returns the value of attribute starts_with.
36266 36267 36268 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36266 def starts_with @starts_with end |
#suffix ⇒ Object (readonly)
Returns the value of attribute suffix.
36266 36267 36268 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36266 def suffix @suffix end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36281 36282 36283 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36281 def copy(incoming={}) OrderNumberGeneratorPrefixSuffix.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
36285 36286 36287 36288 36289 36290 36291 36292 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36285 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 ⇒ Object
36277 36278 36279 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36277 def to_json JSON.dump(to_hash) end |