class ActiveWorksheet::Base

Public Class Methods

adapter() click to toggle source
# File lib/active_worksheet/base.rb, line 35
def adapter
  if is_source_local?
    ActiveWorksheet::Adapters::FileAdapter.new(source: File.expand_path(source))
  else
    ActiveWorksheet::Adapters::GoogleSheetsAdapter.new(
      source: source,
      authorization: authorization
    )
  end
end
all() click to toggle source
# File lib/active_worksheet/base.rb, line 13
def all
  adapter.all.map do |row|
    new(row)
  end
end
count() click to toggle source
# File lib/active_worksheet/base.rb, line 31
def count
  adapter.count
end
find(index) click to toggle source
# File lib/active_worksheet/base.rb, line 19
def find(index)
  new(adapter.find(index))
end
first() click to toggle source
# File lib/active_worksheet/base.rb, line 23
def first
  new(adapter.first)
end
is_source_local?() click to toggle source
# File lib/active_worksheet/base.rb, line 46
def is_source_local?
  self.source.is_a?(File) || File.exists?(File.expand_path(self.source))
end
is_source_remote?() click to toggle source
# File lib/active_worksheet/base.rb, line 50
def is_source_remote?
  !is_source_local?
end
last() click to toggle source
# File lib/active_worksheet/base.rb, line 27
def last
  new(adapter.last)
end