Fixnum is deprecated in Ruby 2.4

This commit is contained in:
Cody Cutrer 2017-03-02 13:44:08 -07:00
parent b2927ae44a
commit c9eb3cee4c
3 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ module CassandraCQL
def fetch_hash
if block_given?
while row = fetch_row
if row.kind_of?(Fixnum)
if row.kind_of?(Integer)
yield({row => row})
else
yield row.to_hash
@ -115,7 +115,7 @@ module CassandraCQL
end
else
if row = fetch_row
if row.kind_of?(Fixnum)
if row.kind_of?(Integer)
{row => row}
else
row.to_hash

View File

@ -22,7 +22,7 @@ module CassandraCQL
@row, @schema = row, schema
@value_cache = Hash.new { |h, key|
# If it's a number and not one of our columns, assume it's an index
if key.kind_of?(Fixnum) and !column_indices.key?(key)
if key.kind_of?(Integer) and !column_indices.key?(key)
column_name = column_names[key]
column_index = key
else

View File

@ -159,7 +159,7 @@ describe "cast_to_cql" do
end
end
context "with a Fixnum object" do
context "with a Integer object" do
it "should return the same object" do
Statement.cast_to_cql(15).should eq(15)
end
@ -209,7 +209,7 @@ describe "cast_to_cql" do
end
end
context "with an array of Fixnums" do
context "with an array of Integers" do
it "should equal itself" do
arr = [1, 2, 3]
Statement.cast_to_cql(arr).should eq(arr)