Class: Bently::Recipe::Insert

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

Returns a new instance of Insert.



69
70
71
# File 'lib/bently/recipe.rb', line 69

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



68
69
70
# File 'lib/bently/recipe.rb', line 68

def args
  @args
end

#dataObject (readonly)

Returns the value of attribute data.



68
69
70
# File 'lib/bently/recipe.rb', line 68

def data
  @data
end

#fileObject (readonly)

Returns the value of attribute file.



68
69
70
# File 'lib/bently/recipe.rb', line 68

def file
  @file
end

#optionsObject (readonly)

Returns the value of attribute options.



68
69
70
# File 'lib/bently/recipe.rb', line 68

def options
  @options
end

Instance Method Details

#afterObject



72
73
74
# File 'lib/bently/recipe.rb', line 72

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