Class: Bently::Recipe::Prepend

Inherits:
Operation show all
Defined in:
lib/bently/recipe.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Operation

#say

Constructor Details

#initialize(*args) ⇒ Prepend

Returns a new instance of Prepend.



59
60
61
# File 'lib/bently/recipe.rb', line 59

def initialize *args
  @file, @data = @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



58
59
60
# File 'lib/bently/recipe.rb', line 58

def args
  @args
end

#dataObject (readonly)

Returns the value of attribute data.



58
59
60
# File 'lib/bently/recipe.rb', line 58

def data
  @data
end

#fileObject (readonly)

Returns the value of attribute file.



58
59
60
# File 'lib/bently/recipe.rb', line 58

def file
  @file
end

Instance Method Details

#afterObject



62
63
64
# File 'lib/bently/recipe.rb', line 62

def after
  @data.each_line.each_with_index.map{|l,i| [i+1, l] }
end