Class: Io::Flow::V0::Models::FieldValidationMax

Inherits:
FieldValidationRule show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from FieldValidationRule

#discriminator

Instance Method Summary collapse

Methods inherited from FieldValidationRule

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ FieldValidationMax



31447
31448
31449
31450
31451
31452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31447

def initialize(incoming={})
  super(:discriminator => FieldValidationRule::Types::FIELD_VALIDATION_MAX)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:length], 'FieldValidationMax')
  @length = HttpClient::Preconditions.assert_class('length', opts.delete(:length), Integer)
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



31445
31446
31447
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31445

def length
  @length
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31458
31459
31460
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31458

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

#subtype_to_hashObject



31462
31463
31464
31465
31466
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31462

def subtype_to_hash
  {
    :length => length
  }
end

#to_jsonObject



31454
31455
31456
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31454

def to_json
  JSON.dump(to_hash)
end