class Modernize::VersionParsingContext

Class for the context to executed the block in.

Public Class Methods

new() click to toggle source
# File lib/modernizer/version_parser.rb, line 15
def initialize
  @maps = []
end

Public Instance Methods

method_missing(method, *args, &block) click to toggle source

Figures out which translations are done for each version.

# File lib/modernizer/version_parser.rb, line 21
def method_missing(method, *args, &block)
  raise ArgumentError.new("wrong number of arguments (#{args.size} for 1)") if args.size != 1
  raise NoMethodError.new("Undefined translation method #{method}") unless MapMethods.respond_to?(method)
  @maps << {name: method, field: args[0], block: block}
end
migration() click to toggle source

Returns all the translations for a verion.

# File lib/modernizer/version_parser.rb, line 29
def migration
  @maps
end