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.



33609
33610
33611
33612
33613
33614
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33609

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.



33607
33608
33609
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33607

def length
  @length
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



33620
33621
33622
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33620

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

#subtype_to_hashObject



33624
33625
33626
33627
33628
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33624

def subtype_to_hash
  {
    :length => length
  }
end

#to_jsonObject



33616
33617
33618
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33616

def to_json
  JSON.dump(to_hash)
end