Class: Io::Flow::V0::Models::OrderNumberGeneratorDefaults

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

Returns a new instance of OrderNumberGeneratorDefaults.



32236
32237
32238
32239
32240
32241
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32236

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @starts_with = HttpClient::Preconditions.assert_class('starts_with', (x = opts.delete(:starts_with); x.nil? ? 1001 : x), Integer)
  @min_hex_length = HttpClient::Preconditions.assert_class('min_hex_length', (x = opts.delete(:min_hex_length); x.nil? ? 6 : x), Integer)
  @min_starts_with = HttpClient::Preconditions.assert_class('min_starts_with', (x = opts.delete(:min_starts_with); x.nil? ? 1 : x), Integer)
end

Instance Attribute Details

#min_hex_lengthObject (readonly)

Returns the value of attribute min_hex_length.



32234
32235
32236
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32234

def min_hex_length
  @min_hex_length
end

#min_starts_withObject (readonly)

Returns the value of attribute min_starts_with.



32234
32235
32236
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32234

def min_starts_with
  @min_starts_with
end

#starts_withObject (readonly)

Returns the value of attribute starts_with.



32234
32235
32236
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32234

def starts_with
  @starts_with
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32247
32248
32249
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32247

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

#to_hashObject



32251
32252
32253
32254
32255
32256
32257
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32251

def to_hash
  {
    :starts_with => starts_with,
    :min_hex_length => min_hex_length,
    :min_starts_with => min_starts_with
  }
end

#to_jsonObject



32243
32244
32245
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32243

def to_json
  JSON.dump(to_hash)
end