Class: Sheet::Open

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Open

Returns a new instance of Open.



5
6
7
# File 'lib/sheet/open.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/open.rb', line 3

def name
  @name
end

Instance Method Details

#openObject



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

def open
  if Sheet.sheet_exists?(name)
    process_sheet_content
  else
    Sheet.display "A cheat named #{name} doesn't exist.\nYou can create one with sheet new #{name}"
  end
end