Class: AspireBudget::Worksheets::WorksheetBase Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/aspire_budget/worksheets/worksheet_base.rb

Overview

This class is abstract.

Subclass and reimplement ws_title to implement a custom worksheet

Direct Known Subclasses

BackendData, Transactions

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session: nil, spreadsheet_key: nil) ⇒ Object

Returns a new instance of the calling class configured with an agent.

Parameters:

  • session (GoogleDrive::Session) (defaults to: nil)
  • spreadsheet_key (String) (defaults to: nil)

    spreadsheet key as per its url

See Also:



35
36
37
38
39
# File 'lib/aspire_budget/worksheets/worksheet_base.rb', line 35

def initialize(session: nil, spreadsheet_key: nil)
  @session = session
  @spreadsheet_key = spreadsheet_key
  @agent = AspireBudget.configuration.agent(@session, @spreadsheet_key)
end

Class Method Details

.instanceObject

Returns an instance of the current object.

Returns:

  • an instance of the current object



12
13
14
# File 'lib/aspire_budget/worksheets/worksheet_base.rb', line 12

def instance
  Thread.current[to_s] ||= new
end

Instance Method Details

#dirty?Boolean

Returns Whether the worksheet has unsaved changes.

Returns:

  • (Boolean)

    Whether the worksheet has unsaved changes



42
43
44
# File 'lib/aspire_budget/worksheets/worksheet_base.rb', line 42

def dirty?
  ws.dirty?
end