Class: Io::Flow::V0::Models::FieldValidationRequiredIfPresent
- Inherits:
-
FieldValidationRule
- Object
- FieldValidationRule
- Io::Flow::V0::Models::FieldValidationRequiredIfPresent
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Indicates a field is required if it is presented in the user interface
Instance Attribute Summary collapse
-
#placeholder ⇒ Object
readonly
Returns the value of attribute placeholder.
Attributes inherited from FieldValidationRule
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ FieldValidationRequiredIfPresent
constructor
A new instance of FieldValidationRequiredIfPresent.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from FieldValidationRule
Constructor Details
#initialize(incoming = {}) ⇒ FieldValidationRequiredIfPresent
Returns a new instance of FieldValidationRequiredIfPresent.
43210 43211 43212 43213 43214 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43210 def initialize(incoming={}) super(:discriminator => FieldValidationRule::Types::FIELD_VALIDATION_REQUIRED_IF_PRESENT) opts = HttpClient::Helper.symbolize_keys(incoming) @placeholder = (x = opts.delete(:placeholder); x.nil? ? nil : HttpClient::Preconditions.assert_class('placeholder', x, String)) end |
Instance Attribute Details
#placeholder ⇒ Object (readonly)
Returns the value of attribute placeholder.
43208 43209 43210 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43208 def placeholder @placeholder end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
43220 43221 43222 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43220 def copy(incoming={}) FieldValidationRequiredIfPresent.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
43224 43225 43226 43227 43228 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43224 def subtype_to_hash { :placeholder => placeholder } end |
#to_json ⇒ Object
43216 43217 43218 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43216 def to_json JSON.dump(to_hash) end |