Class: Rant::RantVar::Constraints::String
- Includes:
- Constraint
- Defined in:
- lib/rant/import/var/strings.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#default ⇒ Object
25 26 27 |
# File 'lib/rant/import/var/strings.rb', line 25 def default "" end |
#filter(val) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/rant/import/var/strings.rb', line 16 def filter(val) if val.respond_to? :to_str val.to_str elsif Symbol === val val.to_s else raise ConstraintError.new(self, val) end end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/rant/import/var/strings.rb', line 28 def to_s "string" end |