Class: ESA::Contexts::DateContext

Inherits:
ESA::Context
  • Object
show all
Defined in:
app/models/esa/contexts/date_context.rb

Direct Known Subclasses

OpenCloseContext

Instance Method Summary collapse

Methods inherited from ESA::Context

#amounts, #apply, #can_be_persisted?, #change_total, #check_freshness, #closing_context, #effective_contexts, #effective_end_date, #effective_path, #effective_start_date, #events, #flags, #has_subcontext_namespaces?, #is_fresh?, #is_root?, #is_subcontext?, #is_update_needed?, #last_transaction_time, #next_freshness_timestamp, #opening_context, #subcontext_namespaces, #transactions, #update!, #update_freshness_timestamp!

Instance Method Details

#following_contextObject



18
19
20
21
22
23
24
25
# File 'app/models/esa/contexts/date_context.rb', line 18

def following_context
  if self.end_date.present?
    DateContext.new chart: self.chart,
                    start_date: self.end_date + 1.day
  else
    nil
  end
end

#preceeding_contextObject



9
10
11
12
13
14
15
16
# File 'app/models/esa/contexts/date_context.rb', line 9

def preceeding_context
  if self.start_date.present?
    DateContext.new chart: self.chart,
                    end_date: self.start_date - 1.day
  else
    nil
  end
end