Module: Configru::OptionMethods
- Included in:
- Option, RequiredOption
- Defined in:
- lib/configru/option.rb
Instance Method Summary collapse
Instance Method Details
#transform(value) ⇒ Object
16 17 18 19 |
# File 'lib/configru/option.rb', line 16 def transform(value) return value unless self.transformation self.transformation[value] end |
#type?(value) ⇒ Boolean
3 4 5 |
# File 'lib/configru/option.rb', line 3 def type?(value) value.nil? || value.is_a?(self.type) end |
#valid?(value) ⇒ Boolean
7 8 9 10 11 12 13 14 |
# File 'lib/configru/option.rb', line 7 def valid?(value) return true unless self.validation if self.validation.is_a? Array self.validation.include? value else self.validation === value end end |