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.



43128
43129
43130
43131
43132
43133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43128

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.



43126
43127
43128
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43126

def length
  @length
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



43139
43140
43141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43139

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

#subtype_to_hashObject



43143
43144
43145
43146
43147
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43143

def subtype_to_hash
  {
    :length => length
  }
end

#to_jsonObject



43135
43136
43137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43135

def to_json
  JSON.dump(to_hash)
end