Sha256: 7e1127f84b3c58f4e6ddb650dfad97473adf8d0b8bc89e13d0e27510e365b4a8
Contents?: true
Size: 766 Bytes
Versions: 17
Compression:
Stored size: 766 Bytes
Contents
class Errata class Erratum class Transform < Erratum ALLOWED_METHODS = %w{upcase downcase} attr_accessor :matching_expression, :string_method def initialize(errata, options = {}) super set_matching_expression(options) @string_method = options[:y] raise "string method (#{@string_method}) needs to be in (#{ALLOWED_METHODS.join(', ')})" unless ALLOWED_METHODS.include?(@string_method) end def inspect super + " matching_expression=#{matching_expression} string_method=#{string_method}>" end def correct!(row) super(row) do row[column].gsub!(matching_expression) { |match| match.send(string_method) } end end end end end
Version data entries
17 entries across 17 versions & 3 rubygems