Method: Transpec::Record#initialize

Defined in:
lib/transpec/record.rb

#initialize(old_syntax, new_syntax, options = {}) ⇒ Record

Returns a new instance of Record.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/transpec/record.rb', line 14

def initialize(old_syntax, new_syntax, options = {})
  # Keep these syntax data as symbols for:
  #   * Better memory footprint
  #   * Better summarizing performance in Report
  @old_syntax_type = old_syntax && old_syntax.to_sym
  @new_syntax_type = new_syntax && new_syntax.to_sym

  @type = options[:type]
  @annotation = options[:annotation]

  fail ArgumentError, "Invalid type: #{type}" unless TYPES.include?(type)
end