Method: GoogleSheets#sheet_id

Defined in:
lib/googlesheets.rb

#sheet_id(obj) ⇒ Object



121
122
123
124
125
126
127
# File 'lib/googlesheets.rb', line 121

def sheet_id(obj)
  case obj
    when /^#(\d+)$/ then sheets[$1.to_i - 1].sheet_id
    when Integer    then obj
    else sheets.first_result {|item| item.sheet_id if item.title == obj}
  end
end