Class: Io::Flow::V0::Models::FieldValidationMin

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 = {}) ⇒ FieldValidationMin

Returns a new instance of FieldValidationMin.



30379
30380
30381
30382
30383
30384
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30379

def initialize(incoming={})
  super(:discriminator => FieldValidationRule::Types::FIELD_VALIDATION_MIN)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:length], 'FieldValidationMin')
  @length = HttpClient::Preconditions.assert_class('length', opts.delete(:length), Integer)
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



30377
30378
30379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30377

def length
  @length
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30390
30391
30392
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30390

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

#subtype_to_hashObject



30394
30395
30396
30397
30398
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30394

def subtype_to_hash
  {
    :length => length
  }
end

#to_jsonObject



30386
30387
30388
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30386

def to_json
  JSON.dump(to_hash)
end