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

Returns a new instance of FieldValidationMax.



28547
28548
28549
28550
28551
28552
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28547

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.



28545
28546
28547
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28545

def length
  @length
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



28558
28559
28560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28558

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

#subtype_to_hashObject



28562
28563
28564
28565
28566
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28562

def subtype_to_hash
  {
    :length => length
  }
end

#to_jsonObject



28554
28555
28556
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28554

def to_json
  JSON.dump(to_hash)
end