capitalism-journal 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4930b770ce5d522576dbe1d65e45dd929034954
4
- data.tar.gz: 90e4b7fc47b9841cc261e3bfe13e38a0634b4ef6
3
+ metadata.gz: f6485a3ffba589b67ea11bdc48c089e812446d98
4
+ data.tar.gz: 1b121b4f8af1621722094d2f7c158123c62b1473
5
5
  SHA512:
6
- metadata.gz: 672848b69c9accee5d55331c91fb23dd86b3a56e6f2696139ea2878f04862747863f83b8ca44c2f6d14a27083fdb1c3bdb86dd2ea870f15dbe563fb712911190
7
- data.tar.gz: f768e673ce491e762116c564b3b362fd3d1056933036b15cd36ceab544a803f5dd4c00b101b6619ead749791687d8a9ca524811776854c71410ab1a23fab9e55
6
+ metadata.gz: c81cb78478a855a184d82f89fb1cb6c31e60cfa8a9113b031973a41367750f6986e66f710fe3813c26f209a0757891236c9908ee39ef44fcf40ccc22c76bcd79
7
+ data.tar.gz: 522d96fd1dc51eee6898d9b2ce477fe3d934ef5f2424df55f28249412e92796b8f5452925a80ba0c2a8c45f611b655356f16d2e0690d5a68667305782377472a
data/README.md CHANGED
@@ -46,10 +46,10 @@ By default journal accepts events with arbitrary timestamps and values.
46
46
 
47
47
  For a custom validation inject a class that responds to `#call.(journal, event)`:
48
48
 
49
- event_validator = -> (_event, _journal) { false }
49
+ event_validator = -> (_journal, _event) { false }
50
50
  journal = Capitalism::Journal.new(event_validator)
51
51
  journal.add
52
- => Capitalism::Journal::InvalidEvent
52
+ => Capitalism::Journal::InvalidJournalEvent
53
53
 
54
54
  ## Reading events
55
55
 
@@ -1,5 +1,5 @@
1
1
  module Capitalism
2
2
  class Journal
3
- VERSION = '0.8.0'.freeze
3
+ VERSION = '0.8.1'.freeze
4
4
  end
5
5
  end
@@ -2,19 +2,19 @@ require 'ostruct'
2
2
 
3
3
  module Capitalism
4
4
  class Journal
5
- class InvalidEvent < StandardError
5
+ class InvalidJournalEvent < StandardError
6
6
  end
7
7
 
8
8
  attr_reader :event_validator, :events
9
9
 
10
- def initialize(event_validator = -> (_event, _journal) { true })
10
+ def initialize(event_validator = -> (_journal, _event) { true })
11
11
  @event_validator = event_validator
12
12
  @events = []
13
13
  end
14
14
 
15
15
  def add(timestamp: Time.now, value: true)
16
16
  event = OpenStruct.new({ timestamp: timestamp, value: value })
17
- raise InvalidEvent unless event_validator.call(event, self)
17
+ raise InvalidJournalEvent unless event_validator.call(event, self)
18
18
  @events << event
19
19
  nil
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capitalism-journal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Zharikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-25 00:00:00.000000000 Z
11
+ date: 2017-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler