Class: Io::Flow::V0::Models::OrderNumberGeneratorFixedLength

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 = {}) ⇒ OrderNumberGeneratorFixedLength

Returns a new instance of OrderNumberGeneratorFixedLength.



38189
38190
38191
38192
38193
38194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38189

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

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



38187
38188
38189
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38187

def length
  @length
end

#paddingObject (readonly)

Returns the value of attribute padding.



38187
38188
38189
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38187

def padding
  @padding
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



38200
38201
38202
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38200

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

#to_hashObject



38204
38205
38206
38207
38208
38209
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38204

def to_hash
  {
    :length => length,
    :padding => padding
  }
end

#to_jsonObject



38196
38197
38198
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38196

def to_json
  JSON.dump(to_hash)
end