Class: Io::Flow::V0::Models::OrderNumberGeneratorHexadecimal
- Inherits:
-
OrderNumberGenerator
- Object
- OrderNumberGenerator
- Io::Flow::V0::Models::OrderNumberGeneratorHexadecimal
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Hexadecimal generator generates a random string, starting with a letter, of a given length
Instance Attribute Summary collapse
-
#length ⇒ Object
readonly
Returns the value of attribute length.
Attributes inherited from OrderNumberGenerator
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderNumberGeneratorHexadecimal
constructor
A new instance of OrderNumberGeneratorHexadecimal.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from OrderNumberGenerator
Constructor Details
#initialize(incoming = {}) ⇒ OrderNumberGeneratorHexadecimal
Returns a new instance of OrderNumberGeneratorHexadecimal.
32295 32296 32297 32298 32299 32300 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32295 def initialize(incoming={}) super(:discriminator => OrderNumberGenerator::Types::ORDER_NUMBER_GENERATOR_HEXADECIMAL) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:length], 'OrderNumberGeneratorHexadecimal') @length = HttpClient::Preconditions.assert_class('length', opts.delete(:length), Integer) end |
Instance Attribute Details
#length ⇒ Object (readonly)
Returns the value of attribute length.
32293 32294 32295 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32293 def length @length end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
32306 32307 32308 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32306 def copy(incoming={}) OrderNumberGeneratorHexadecimal.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
32310 32311 32312 32313 32314 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32310 def subtype_to_hash { :length => length } end |
#to_json ⇒ Object
32302 32303 32304 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32302 def to_json JSON.dump(to_hash) end |