libledger 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88e563136240529f727ae98f888e3b81caa4720b
4
- data.tar.gz: 3a4eae174f0515427d6fdc3197357b964198e3c2
3
+ metadata.gz: 21d2a5e653fea800acff701648c477dc42862403
4
+ data.tar.gz: 9648f9b22ff52900763a1b24fab12c6c2d178bd3
5
5
  SHA512:
6
- metadata.gz: f8f994d6113d6c16d605cfa1047d646cd839bdcaafcb1bb9f4d3fbff5d315d1a738fbcbb98e665a2ae9b0984bf44a2c281df24c049df51417e5af134bb498690
7
- data.tar.gz: 6d95d946a03703961735f0363ca6d41b689bf8c8c9a23cfd59b217b46e2c4dc196d2a29317608d3edb606a1f0a1b941a2fca338e84e0a440c4aa84292bb79e7a
6
+ metadata.gz: 2bfcf8b26f193afab0340892d76834dfb59b04c58d6030c501ee5528a6cdcf69b5f2826998f0e52a4f90b12d6b2671cf733632ac0d95c2618f92942ef2c68311
7
+ data.tar.gz: d41846d4e84a973901532c2b20b7f9b40e04fc0bc61006504f77f011e86ffd80bce8553dc89d3437a0e7910378de4fbd8c9c0aea472c283a0fdc3613595ebf74
@@ -12,6 +12,8 @@ module Ledger
12
12
  ##
13
13
  # Declaration for entry object
14
14
  class Entry
15
+ include Comparable
16
+
15
17
  def initialize(params = {})
16
18
  @data = params
17
19
  end
@@ -46,6 +48,11 @@ module Ledger
46
48
  subject_line + action_lines.join("\n") + "\n"
47
49
  end
48
50
 
51
+ def <=>(other)
52
+ return nil unless other.is_a? Ledger::Entry
53
+ date <=> other.date
54
+ end
55
+
49
56
  private
50
57
 
51
58
  def subject_line
data/libledger.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'libledger'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.3'
4
4
  s.date = Time.now.strftime('%Y-%m-%d')
5
5
 
6
6
  s.summary = 'Library for interacting with Ledger files'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libledger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-05 00:00:00.000000000 Z
11
+ date: 2017-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop