Class: DCA::Redis::Session
- Inherits:
-
Ohm::Model
- Object
- Ohm::Model
- DCA::Redis::Session
- Defined in:
- lib/dca/notifier/redis/models/session.rb
Instance Method Summary collapse
- #add_failure(exception) ⇒ Object
- #analyze_state(state) ⇒ Object
- #fetch_state(state) ⇒ Object
- #inc_analyze(state) ⇒ Object
- #inc_fetch(state, result) ⇒ Object
- #validate ⇒ Object
Instance Method Details
#add_failure(exception) ⇒ Object
47 48 49 |
# File 'lib/dca/notifier/redis/models/session.rb', line 47 def add_failure exception self.failures.add FailureNotify.create(:message => exception., :stack => exception.backtrace) end |
#analyze_state(state) ⇒ Object
21 22 23 |
# File 'lib/dca/notifier/redis/models/session.rb', line 21 def analyze_state state self.analyzed.find(:state => state).first end |
#fetch_state(state) ⇒ Object
25 26 27 |
# File 'lib/dca/notifier/redis/models/session.rb', line 25 def fetch_state state self.fetched.find(:state => state).first end |
#inc_analyze(state) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/dca/notifier/redis/models/session.rb', line 29 def inc_analyze state notify = self.analyzed.find(:state => state).first if notify.nil? notify = AnalyzeNotify.create(:state => state) self.analyzed.add notify end notify.incr :count end |
#inc_fetch(state, result) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/dca/notifier/redis/models/session.rb', line 38 def inc_fetch state, result notify = self.fetched.find(:state => state).first if notify.nil? notify = FetchNotify.create(:state => state) self.fetched.add notify end notify.incr result end |
#validate ⇒ Object
17 18 19 |
# File 'lib/dca/notifier/redis/models/session.rb', line 17 def validate assert_present :uid end |