class Pragmater::Processors::Inserter
Inserts new pragma comments.
Attributes
body[R]
comments[R]
Public Class Methods
new(comments, body)
click to toggle source
# File lib/pragmater/processors/inserter.rb, line 7 def initialize comments, body @comments = comments @body = body end
Public Instance Methods
call()
click to toggle source
# File lib/pragmater/processors/inserter.rb, line 12 def call body.first.then do |first| comments.append "\n" unless first == "\n" || body.empty? comments + body end end