Class: AspireBudget::Worksheets::WorksheetBase

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

Direct Known Subclasses

BackendData, Transactions

Constant Summary

Constants included from Utils

Utils::DATE_FORMAT, Utils::TRANSACTION_STATUS_MAPPING

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils

parse_currency, parse_date, parse_status, serialize_currency, serialize_date, serialize_status

Constructor Details

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

Returns a new instance of WorksheetBase.


29
30
31
# File 'lib/worksheets/worksheet_base.rb', line 29

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

Class Method Details

.instanceObject


24
25
26
# File 'lib/worksheets/worksheet_base.rb', line 24

def instance
  @instance ||= new
end

.method_missing(method_name, *args, &block) ⇒ Object


12
13
14
15
16
17
18
# File 'lib/worksheets/worksheet_base.rb', line 12

def method_missing(method_name, *args, &block)
  if instance.respond_to?(method_name)
    instance.public_send(method_name, *args, &block)
  else
    super
  end
end

.respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)

20
21
22
# File 'lib/worksheets/worksheet_base.rb', line 20

def respond_to_missing?(method_name, include_private = false)
  instance.respond_to?(method_name) || super
end

Instance Method Details

#dirty?Boolean

Returns:

  • (Boolean)

33
34
35
# File 'lib/worksheets/worksheet_base.rb', line 33

def dirty?
  ws.dirty?
end