Module: Garden

Defined in:
lib/garden.rb,
lib/garden/version.rb,
lib/garden/mediators.rb,
lib/garden/spreadsheets.rb

Defined Under Namespace

Modules: Mediators Classes: Excel

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.excel(file_name_or_path) ⇒ Object

def self.plant

# todo

end

def self.all

# todo

end

def self.spreadsheets

# todo

end


21
22
23
24
# File 'lib/garden.rb', line 21

def self.excel file_name_or_path
  filepath = resolve_file_path(file_name_or_path)
  Excel.new filepath
end

.resolve_file_path(name_or_path) ⇒ Object


26
27
28
# File 'lib/garden.rb', line 26

def self.resolve_file_path name_or_path
  File.exists?(name_or_path) ? name_or_path : File.join(Rails.root, "db/seeds/#{name_or_path}.xls")
end