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.



32546
32547
32548
32549
32550
32551
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32546

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.



32544
32545
32546
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32544

def length
  @length
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32557
32558
32559
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32557

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

#subtype_to_hashObject



32561
32562
32563
32564
32565
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32561

def subtype_to_hash
  {
    :length => length
  }
end

#to_jsonObject



32553
32554
32555
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32553

def to_json
  JSON.dump(to_hash)
end