Class: NxtSupport::Preprocessors::StripPreprocessor
- Inherits:
-
Object
- Object
- NxtSupport::Preprocessors::StripPreprocessor
- Defined in:
- lib/nxt_support/preprocessors/strip_preprocessor.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(value) ⇒ StripPreprocessor
constructor
A new instance of StripPreprocessor.
Constructor Details
#initialize(value) ⇒ StripPreprocessor
Returns a new instance of StripPreprocessor.
8 9 10 |
# File 'lib/nxt_support/preprocessors/strip_preprocessor.rb', line 8 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/nxt_support/preprocessors/strip_preprocessor.rb', line 6 def value @value end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/nxt_support/preprocessors/strip_preprocessor.rb', line 12 def call return if value.nil? value.strip! value rescue NoMethodError => e raise WrongTypeError, "Tried to call #{e.name} on #{value}, but #{value} does not respond to #{e.name}" end |