Class: Rulix::Mutators::Default
- Inherits:
-
Object
- Object
- Rulix::Mutators::Default
- Defined in:
- lib/rulix/mutators/default.rb
Instance Attribute Summary collapse
-
#default_val ⇒ Object
Returns the value of attribute default_val.
Instance Method Summary collapse
- #call(string) ⇒ Object
-
#initialize(default_val) ⇒ Default
constructor
A new instance of Default.
- #to_proc ⇒ Object
Constructor Details
#initialize(default_val) ⇒ Default
Returns a new instance of Default.
6 7 8 |
# File 'lib/rulix/mutators/default.rb', line 6 def initialize default_val self.default_val = default_val end |
Instance Attribute Details
#default_val ⇒ Object
Returns the value of attribute default_val.
4 5 6 |
# File 'lib/rulix/mutators/default.rb', line 4 def default_val @default_val end |
Instance Method Details
#call(string) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/rulix/mutators/default.rb', line 14 def call string if string string else default_val end end |
#to_proc ⇒ Object
10 11 12 |
# File 'lib/rulix/mutators/default.rb', line 10 def to_proc method(:call) end |