Class: Bently::Recipe::Append

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) ⇒ Append

Returns a new instance of Append.



48
49
50
# File 'lib/bently/recipe.rb', line 48

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

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



47
48
49
# File 'lib/bently/recipe.rb', line 47

def data
  @data
end

#fileObject (readonly)

Returns the value of attribute file.



47
48
49
# File 'lib/bently/recipe.rb', line 47

def file
  @file
end

Instance Method Details

#afterObject



52
53
54
# File 'lib/bently/recipe.rb', line 52

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

#argsObject



51
# File 'lib/bently/recipe.rb', line 51

def args; [@file, @data] end