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.



30858
30859
30860
30861
30862
30863
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30858

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.



30856
30857
30858
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30856

def pattern
  @pattern
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30869
30870
30871
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30869

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

#subtype_to_hashObject



30873
30874
30875
30876
30877
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30873

def subtype_to_hash
  {
    :pattern => pattern
  }
end

#to_jsonObject



30865
30866
30867
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30865

def to_json
  JSON.dump(to_hash)
end