Class: Io::Flow::V0::Models::FieldValidationPattern

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

Returns a new instance of FieldValidationPattern.



32699
32700
32701
32702
32703
32704
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32699

def initialize(incoming={})
  super(:discriminator => FieldValidationRule::Types::FIELD_VALIDATION_PATTERN)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:pattern], 'FieldValidationPattern')
  @pattern = HttpClient::Preconditions.assert_class('pattern', opts.delete(:pattern), String)
end

Instance Attribute Details

#patternObject (readonly)

Returns the value of attribute pattern.



32697
32698
32699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32697

def pattern
  @pattern
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32710
32711
32712
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32710

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

#subtype_to_hashObject



32714
32715
32716
32717
32718
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32714

def subtype_to_hash
  {
    :pattern => pattern
  }
end

#to_jsonObject



32706
32707
32708
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32706

def to_json
  JSON.dump(to_hash)
end