plata 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/plata/version.rb +1 -1
  3. data/lib/plata.rb +6 -5
  4. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20ebb986f737630d2254971e2a3bf7a9bbf204c8675889770c288c5f557f6b0c
4
- data.tar.gz: 1ed6604dda43e22034e510ecbff4c10680f0046b7c876bfd18695e3ee1f91b36
3
+ metadata.gz: ddede170dc49d1016d0d2ddadbbc2e86bb789ec3928c41ae2584dd3f944dc783
4
+ data.tar.gz: 322b1394c53f825e1eca6815a5ab0bfc5435c77efa4941d8ab2cb91c89ba9c85
5
5
  SHA512:
6
- metadata.gz: 01a8864c0cf6e75967fb6c328bfa56ce4f0be735ab4ec72f7a063a831ea76a283523295ed7e398376dc4e3e0a08882ccde59c53375537c6ced7039858cefed05
7
- data.tar.gz: cb9722b3eafb690d5f5f8cb84facd79f72bc5f22513d82c7d1ac8528a971f5998248979fb2d01d54c64eee1b272175119722251138333513e0f6e2cbee58f167
6
+ metadata.gz: 959a61dece9398c107e3806285903b9220b9a37ac75ec28c8c5c776d95f1544344d16f5ab10d19ac0303fd57433f6b36a440cff55b837babeb08b29377071cb3
7
+ data.tar.gz: 7a4adf2bf4bdb7c7d00ebed4e083b6abace7103df4105f45a95772f62a6be2fa83e62b6de63d2bd0c92794566f6fc64b0ccb4293857dea7ecf825d5a5e5e9932
data/lib/plata/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Plata
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
data/lib/plata.rb CHANGED
@@ -16,22 +16,22 @@ module Plata
16
16
  end
17
17
 
18
18
  module InstanceMethods
19
-
20
19
  def humanize_foo
21
20
  return self.zero_string self.zero?
22
21
  words = []
23
22
  number, decimal = self.to_s.split(".")
24
23
  end
25
24
 
26
-
27
25
  def humanize
28
-
29
26
  words = []
30
27
 
31
28
  number = self.to_f
32
29
 
33
- if number.to_i == 0
30
+ if number.zero?
34
31
  words << self.zero_string
32
+ elsif number > 0 && number < 1
33
+ words << I18n.t('plata.zero')
34
+ decimal = number.to_s.split('.').last
35
35
  else
36
36
  decimal = number.to_s.split(".")[1].nil? ? 0 : number.to_s.split(".")[1].to_i
37
37
  number = number.to_s.split(".")[0]
@@ -58,7 +58,8 @@ module Plata
58
58
  end
59
59
  end
60
60
  end
61
- return "#{words.reverse.join(' ')} #{conector} #{decimal}/100"
61
+
62
+ "#{words.reverse.join(' ')} #{conector} #{decimal}/100"
62
63
  end
63
64
 
64
65
  protected
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ga6ix
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-02 00:00:00.000000000 Z
11
+ date: 2024-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -61,7 +61,7 @@ files:
61
61
  homepage: https://github.com/gedera/plata
62
62
  licenses: []
63
63
  metadata: {}
64
- post_install_message:
64
+ post_install_message:
65
65
  rdoc_options: []
66
66
  require_paths:
67
67
  - lib
@@ -76,8 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 3.1.2
80
- signing_key:
79
+ rubygems_version: 3.5.18
80
+ signing_key:
81
81
  specification_version: 4
82
82
  summary: Describe a number in words for English, Spanish and Portugues.
83
83
  test_files: []