Class: Sheet::Copy

Inherits:
Object
  • Object
show all
Defined in:
lib/sheet/copy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Copy

Returns a new instance of Copy.



5
6
7
# File 'lib/sheet/copy.rb', line 5

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/sheet/copy.rb', line 3

def name
  @name
end

Instance Method Details

#copyObject



9
10
11
12
13
14
15
# File 'lib/sheet/copy.rb', line 9

def copy
  if name
    check_if_sheet_exists_and_copy_sheet
  else
    Sheet.display("Please specify a sheet name!")
  end
end