active_enum 1.0.0.pre → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4aae7beff8dddf1e7a626ce7c6de2b35fa820f38
4
- data.tar.gz: 3995d9471445a83cf36a771c5ef85c73ca63e54a
3
+ metadata.gz: abc265242b6f277fd73cd50f675eb3e966407cda
4
+ data.tar.gz: 5b4c18dd92b26c6282afa3ba13e131d9ac916bd0
5
5
  SHA512:
6
- metadata.gz: 1047ed7a0228ddb9b1969a5222e6b080cf3f7e8453cc4d635d5ee90cda8206446e4c5b7a178d5f1496ca00c0ec0dd236ae495b3269e60add8878c84bc8147343
7
- data.tar.gz: 008696a99059da7b5a343502ec0a4639d6ffc009acbc2beb5ed80c8903c98afb249ad9ce9c9f0165734fc14870da2c8e808bbc21e6917755c8138d2ac00d7de6
6
+ metadata.gz: c0a0d1e62906848e9a031e6bb8cd27071a3fa4b2b6919d4311eb7fbae2fcfb1676f9a6d292d94d462a167d2b084cccc795e37d58d65c0af25f6db5a9bf1f08f8
7
+ data.tar.gz: 5c9cb81a882a6ddaf6c2e3c6d864598e85d544e91f835ea711b9881a2c710b1b20b5812987481dc50975ee13ff60814cda8967fc36058f67dfed5a873b45947e
data/README.rdoc CHANGED
@@ -7,7 +7,7 @@ Enum values are stored in memory at the moment but I plan to add database and po
7
7
 
8
8
  == Install
9
9
 
10
- Supprots Ruby versions 2.0+.
10
+ Supports Ruby versions 2.0+.
11
11
 
12
12
  From gem version 1.0 onwards this plugin will only have Rails 4+ support. If you need Rails 3 compatibility, {check the 0.9 branch}[https://github.com/adzap/active_enum/tree/0.9].
13
13
 
@@ -29,7 +29,7 @@ module ActiveEnum
29
29
  end
30
30
 
31
31
  def [](index)
32
- if index.is_a?(Fixnum)
32
+ if index.is_a?(Integer)
33
33
  v = lookup_by_id(index)
34
34
  v.send(active_enum_options[:name_column]) unless v.blank?
35
35
  else
@@ -62,13 +62,13 @@ module ActiveEnum
62
62
  def get(index)
63
63
  row = get_value(index)
64
64
  return if row.nil?
65
- index.is_a?(Fixnum) ? row[1] : row[0]
65
+ index.is_a?(Integer) ? row[1] : row[0]
66
66
  end
67
67
  alias_method :[], :get
68
68
 
69
69
  # Access value row array for a given id or name value.
70
70
  def get_value(index)
71
- if index.is_a?(Fixnum)
71
+ if index.is_a?(Integer)
72
72
  store.get_by_id(index)
73
73
  else
74
74
  store.get_by_name(index)
@@ -93,7 +93,7 @@ module ActiveEnum
93
93
  name = hash.delete(:name)
94
94
  meta = hash
95
95
  return id, name, (meta.empty? ? nil : meta)
96
- elsif hash.keys.first.is_a?(Fixnum)
96
+ elsif hash.keys.first.is_a?(Integer)
97
97
  return *Array(hash).first
98
98
  else
99
99
  raise ActiveEnum::InvalidValue, "The value supplied, #{hash}, is not a valid format."
@@ -1,3 +1,3 @@
1
1
  module ActiveEnum
2
- VERSION = '1.0.0.pre'
2
+ VERSION = '1.0.0.rc1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_enum
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre
4
+ version: 1.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Meehan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-09 00:00:00.000000000 Z
11
+ date: 2017-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport