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.



39936
39937
39938
39939
39940
39941
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39936

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.



39934
39935
39936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39934

def pattern
  @pattern
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



39947
39948
39949
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39947

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

#subtype_to_hashObject



39951
39952
39953
39954
39955
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39951

def subtype_to_hash
  {
    :pattern => pattern
  }
end

#to_jsonObject



39943
39944
39945
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39943

def to_json
  JSON.dump(to_hash)
end