simple_enumeration 0.3.0 → 0.3.1

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: ec872ff72f5493bf9a559f6389c2fe334afacd8e0ede01a70f3d3d5bb021d7de
4
- data.tar.gz: aac86cd8fa4d5421d4a0a95ef15ae8e69ea8e65107b0f3f3a2f5764e483077c3
3
+ metadata.gz: 4185a79e2fb62235af02359e628dcf66e8e383a6a28515eb6417e8563306d0c3
4
+ data.tar.gz: 9c49a4b9a449e8b68631817a0f1da254dbe2ae46f290d418c01afa2a9226b90d
5
5
  SHA512:
6
- metadata.gz: 5768db3946b101fb91677ba1b66ed8ee7be592e0009e72d2606a172f2e0e5ecdddd12488cac4507b25282b8d48be89cfbcea7b7d5ca41afa4ee9edfd3df8b502
7
- data.tar.gz: da4892021ce865eac7f5ea81277df579774ac656cd1f68f1b44b2507828c402995a5bb49cd5c8ed9aca62aa5cf9390263bf4e2cd372fb79fa6f4539a318933b3
6
+ metadata.gz: 7abff0c2aeef09566d77e284730a0e93204fd88474ed5d93f913ed99e8b8f74ec100749df5a80c0442c40d8ded89ac0c666e1883108b148e832fb71e12bd3ac3
7
+ data.tar.gz: c1fb0f47dee3462b81678d4d245a3b891b2b15d9d5d1387558d8ff0158f14ccb7962bb782d960d2b9b3e03a01eba42c3aa426b6d82bdc91dc4b9959c66399833
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.3.1] - 2022-01-08
8
+
9
+ ### Fixed
10
+ - Fixed define_simple_enumeration method when with option is given as a class
11
+
7
12
  ## [0.3.0] - 2022-01-08
8
13
 
9
14
  ### Removed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_enumeration (0.2.1)
4
+ simple_enumeration (0.3.1)
5
5
  i18n
6
6
 
7
7
  GEM
@@ -4,7 +4,7 @@ module SimpleEnumeration
4
4
  module DefineSimpleEnumeration
5
5
  def define_simple_enumeration(attribute, options = {})
6
6
  enum_class_name = options[:with] || enum_class_name_for(attribute)
7
- enum_class = const_get(enum_class_name)
7
+ enum_class = enum_class_name.is_a?(String) ? const_get(enum_class_name) : enum_class_name
8
8
 
9
9
  define_method "#{attribute}_enumeration" do
10
10
  enum_class.new(converted_value: send(attribute))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SimpleEnumeration
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_enumeration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Norbert Małecki