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.
33718 33719 33720 33721 33722 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33718 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.
33716 33717 33718 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33716 def placeholder @placeholder end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
33728 33729 33730 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33728 def copy(incoming={}) FieldValidationRequiredIfPresent.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
33732 33733 33734 33735 33736 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33732 def subtype_to_hash { :placeholder => placeholder } end |
#to_json ⇒ Object
33724 33725 33726 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33724 def to_json JSON.dump(to_hash) end |