Class: Jcsv::RBIsElementOf
Overview
Instance Attribute Summary collapse
-
#strings ⇒ Object
readonly
Returns the value of attribute strings.
Attributes included from NextFilter
Instance Method Summary collapse
- #execute(value, context) ⇒ Object
-
#initialize(strings) ⇒ RBIsElementOf
constructor
A new instance of RBIsElementOf.
Methods included from NextFilter
Constructor Details
#initialize(strings) ⇒ RBIsElementOf
Returns a new instance of RBIsElementOf.
121 122 123 124 |
# File 'lib/constraints.rb', line 121 def initialize(strings) @strings = strings super() end |
Instance Attribute Details
#strings ⇒ Object (readonly)
Returns the value of attribute strings.
119 120 121 |
# File 'lib/constraints.rb', line 119 def strings @strings end |
Instance Method Details
#execute(value, context) ⇒ Object
126 127 128 129 130 131 |
# File 'lib/constraints.rb', line 126 def execute(value, context) validateInputNotNull(value, context) raise "Value #{value} not element of #{@strings}:\n#{context}" if !@strings.include?(value) exec_next(value, context) end |