Module: PositionReplacer
- Included in:
- RubyAPI::Mutator::Replacer
- Defined in:
- lib/mutate/replacer.rb
Instance Method Summary collapse
- #position_arg?(arg) ⇒ Boolean
- #replace_pos_argument(options) ⇒ Object
- #replace_position_arg(options) ⇒ Object
Instance Method Details
#position_arg?(arg) ⇒ Boolean
14 15 16 17 |
# File 'lib/mutate/replacer.rb', line 14 def position_arg?(arg) return arg[1] if arg && arg[0] == '#' nil end |
#replace_pos_argument(options) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/mutate/replacer.rb', line 7 def replace_pos_argument() case self.arg when Ruby::String replace_arg_token([:replace_arg]) end end |
#replace_position_arg(options) ⇒ Object
2 3 4 5 |
# File 'lib/mutate/replacer.rb', line 2 def replace_position_arg() pos = position_arg?([:arg]) self.arguments.elements[pos.to_i].replace_pos_argument() end |