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.



43101
43102
43103
43104
43105
43106
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43101

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.



43099
43100
43101
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43099

def length
  @length
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



43112
43113
43114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43112

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

#subtype_to_hashObject



43116
43117
43118
43119
43120
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43116

def subtype_to_hash
  {
    :length => length
  }
end

#to_jsonObject



43108
43109
43110
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43108

def to_json
  JSON.dump(to_hash)
end