rbzk 0.1.6 → 0.1.8

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
  SHA256:
3
- metadata.gz: dc6b7b78fa88e4e3cbea5a63aff9a333e1dea98a796de0cc2ab1a8d875f10a64
4
- data.tar.gz: ab1527c24665247a5de3393fdf83a9aa0f4c74fe9fe933554ed105968584b56e
3
+ metadata.gz: 73a55ff7a558ac52bd29c070e50d62cecaff6881a04e5426777a70a3f4f67cd3
4
+ data.tar.gz: 697c3d0eddfbc1e7c2c71a2fdcdbd937727863776bf03c16beb729797ea507c7
5
5
  SHA512:
6
- metadata.gz: ee91215cdd36830c39e259ab1e42384c8f155d896cb52254105aaf6d36b4167fc7becbd9b4cb632631e32ef23ce2ac57c2de3ecc32990857a56b74a25e26b2d2
7
- data.tar.gz: 9bad7c48f98845263d7183362ae7d19a453035747100605e05f6523a0dafd5d9ce9e264dcbfdf2950c297dcff448027716f9edc1a41c18196d89acf4e5942e8e
6
+ metadata.gz: ca7705c199d61813975fc7200d747cca655f4743c3db9f3a3d23a1dc5967dd2e26e993d4450d62bfca7084cfbff497485f8caed9500b3be6d58a4bc3f9e546ca
7
+ data.tar.gz: c150348cb994e1c30fd3990852e27508d80090df6d3ae66fe7ed74076309d2fbd5f41f800fbc4715162d3444e52d7a6b0c1cf67411dbdf6c964d6560c9cf4093
data/README.md CHANGED
@@ -229,7 +229,7 @@ else
229
229
  # Status: Check-in, Check-out, etc. (Refer to ZK documentation for specific status codes)
230
230
  puts " Status: #{log.status}"
231
231
  # Punch: Fingerprint, Password, Card, etc. (Refer to ZK documentation)
232
- puts " Punch Type: #{log.punch}"
232
+ puts " Punch Type: #{log.punch_name}"
233
233
  puts " Timestamp: #{log.timestamp.strftime('%Y-%m-%d %H:%M:%S')}"
234
234
  puts "---"
235
235
  end
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