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.



32047
32048
32049
32050
32051
32052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32047

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.



32045
32046
32047
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32045

def length
  @length
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32058
32059
32060
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32058

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

#subtype_to_hashObject



32062
32063
32064
32065
32066
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32062

def subtype_to_hash
  {
    :length => length
  }
end

#to_jsonObject



32054
32055
32056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32054

def to_json
  JSON.dump(to_hash)
end