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.



31914
31915
31916
31917
31918
31919
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31914

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.



31912
31913
31914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31912

def length
  @length
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



31925
31926
31927
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31925

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

#subtype_to_hashObject



31929
31930
31931
31932
31933
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31929

def subtype_to_hash
  {
    :length => length
  }
end

#to_jsonObject



31921
31922
31923
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 31921

def to_json
  JSON.dump(to_hash)
end