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.



30804
30805
30806
30807
30808
30809
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30804

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.



30802
30803
30804
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30802

def length
  @length
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30815
30816
30817
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30815

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

#subtype_to_hashObject



30819
30820
30821
30822
30823
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30819

def subtype_to_hash
  {
    :length => length
  }
end

#to_jsonObject



30811
30812
30813
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30811

def to_json
  JSON.dump(to_hash)
end