parameter_substitution 3.2.0 → 3.3.0

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: b1ce2eb4a673fa4ca42d4bfef42b2b18a0b6011dcef6aeb6b8f4c0c0fb30f63b
4
- data.tar.gz: 41b30435287d1dcb7b0b01686c238a49fad6f1d8bf6b414a96a65099dec17f4b
3
+ metadata.gz: 14058d724c701b6bd109ae47b87c51b20a7c24debb243d6d3dff1e935f3f7e03
4
+ data.tar.gz: ab45324eba987431f83b683e2b5c050f665ed29563947a88fd88e5c92253fe66
5
5
  SHA512:
6
- metadata.gz: 3bdabcf306d69fc596a6202bf718f0bcdf3fd53ef4fa3d1a00135e4fb3745846f80c3a21ccfc2e1e73d0488aab7e2ac45e8ae7b578cde55ddf0f9b98fddfe8d6
7
- data.tar.gz: e86ae64208c6cdf3bdae88bb951d54b379d9a622af44c7a1a7cfc981886b21c80eaf2ad1315549c14785057804ec95580a69cd2d177369e3a44fd7fd21469e0e
6
+ metadata.gz: 6f1f14508b7650a70bf6a7a9a1d578084571ab884b4b00c986bada975ee23286f95d3ed066740a6f2a22d050c6ff55c031bff6b520f5d05d5828f12913ce03b3
7
+ data.tar.gz: 159821004ce6108783f98e7a5c71be6529f388612b6dec6f9168b5fa881ef97cfa393d96ec47b15490765dcd7d5bf9ca967735a7812cb7efe339daef80aa1886
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ParameterSubstitution::Formatters::DollarsToCents < ParameterSubstitution::Formatters::Base
4
+ def self.description
5
+ "Converts a dollar amount to cents as an integer"
6
+ end
7
+
8
+ def self.format(value)
9
+ (Float(value) * 100).round.to_i rescue nil
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ParameterSubstitution
4
- VERSION = "3.2.0"
4
+ VERSION = "3.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parameter_substitution
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca Development
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-19 00:00:00.000000000 Z
11
+ date: 2026-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -99,6 +99,7 @@ files:
99
99
  - lib/parameter_substitution/formatters/date_us_dashes.rb
100
100
  - lib/parameter_substitution/formatters/date_us_normal.rb
101
101
  - lib/parameter_substitution/formatters/date_year_first_dashes.rb
102
+ - lib/parameter_substitution/formatters/dollars_to_cents.rb
102
103
  - lib/parameter_substitution/formatters/downcase.rb
103
104
  - lib/parameter_substitution/formatters/duration_as_seconds.rb
104
105
  - lib/parameter_substitution/formatters/duration_as_time.rb