Class: Bently::Recipe::Append
- Defined in:
- lib/bently/recipe.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #after ⇒ Object
- #args ⇒ Object
-
#initialize(*args) ⇒ Append
constructor
A new instance of Append.
Methods inherited from Operation
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
47 48 49 |
# File 'lib/bently/recipe.rb', line 47 def data @data end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
47 48 49 |
# File 'lib/bently/recipe.rb', line 47 def file @file end |
Instance Method Details
#after ⇒ Object
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 |
#args ⇒ Object
51 |
# File 'lib/bently/recipe.rb', line 51 def args; [@file, @data] end |