Class: RBS::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/rbs/diff.rb

Instance Method Summary collapse

Constructor Details

#initialize(type_name:, library_options:, after_path: [], before_path: [], detail: false) ⇒ Diff

Returns a new instance of Diff.



5
6
7
8
9
10
11
# File 'lib/rbs/diff.rb', line 5

def initialize(type_name:, library_options:, after_path: [], before_path: [], detail: false)
  @type_name = type_name
  @library_options = library_options
  @after_path = after_path
  @before_path = before_path
  @detail = detail
end

Instance Method Details

#each_diff(&block) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rbs/diff.rb', line 13

def each_diff(&block)
  return to_enum(:each_diff) unless block

  before_instance_methods, before_singleton_methods, before_constant_children = build_methods(@before_path)
  after_instance_methods, after_singleton_methods, after_constant_children = build_methods(@after_path)

  each_diff_methods(:instance, before_instance_methods, after_instance_methods, &block)
  each_diff_methods(:singleton, before_singleton_methods, after_singleton_methods, &block)

  each_diff_constants(before_constant_children, after_constant_children, &block)
end