rbzk 0.1.5 → 0.1.7

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.
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "rbzk"
3
+ require 'bundler/setup'
4
+ require 'rbzk'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +10,5 @@ require "rbzk"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start(__FILE__)
@@ -12,6 +12,25 @@ module RBZK
12
12
  @uid = uid
13
13
  end
14
14
 
15
+ # Helper predicate for check-in (punch==0)
16
+ def check_in?
17
+ @punch == 0
18
+ end
19
+
20
+ # Helper predicate for check-out (punch==1)
21
+ def check_out?
22
+ @punch == 1
23
+ end
24
+
25
+ # Human readable punch name (0=Check In, 1=Check Out)
26
+ def punch_name
27
+ case @punch
28
+ when 0 then 'Check In'
29
+ when 1 then 'Check Out'
30
+ else "Punch (#{@punch})"
31
+ end
32
+ end
33
+
15
34
  def to_s
16
35
  "#{@user_id} #{@timestamp} #{@status} #{@punch} #{@uid}"
17
36
  end