Class: Pragmater::Parsers::Comments

Inherits:
Object
  • Object
show all
Defined in:
lib/pragmater/parsers/comments.rb

Overview

Manages pragma comments.

Instance Method Summary collapse

Constructor Details

#initialize(older, newer, formatter: Formatters::Main) ⇒ Comments

Returns a new instance of Comments.



7
8
9
10
11
# File 'lib/pragmater/parsers/comments.rb', line 7

def initialize older, newer, formatter: Formatters::Main
  @formatter = formatter
  @older = format older
  @newer = format newer
end

Instance Method Details

#insertObject



13
# File 'lib/pragmater/parsers/comments.rb', line 13

def insert = older.union(newer)

#removeObject



15
# File 'lib/pragmater/parsers/comments.rb', line 15

def remove = older - older.intersection(newer)