Skip to content

Commit 78db477

Browse files
committed
Use Numeric or Integer instead of Fixnum for Ruby 2.4.
1 parent 6019311 commit 78db477

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/json/ld/resource.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def initialize(node_definition, options = {})
9393

9494
##
9595
# Return a hash of this object, suitable for use by for ETag
96-
# @return [Fixnum]
96+
# @return [Integer]
9797
def hash
9898
self.deresolve.hash
9999
end

lib/json/ld/to_rdf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def item_to_rdf(item, graph_name: nil, &block)
2323
# If value is true or false, then set value its canonical lexical form as defined in the section Data Round Tripping. If datatype is null, set it to xsd:boolean.
2424
value = value.to_s
2525
datatype ||= RDF::XSD.boolean.to_s
26-
when Integer, Float, Fixnum
26+
when Numeric
2727
# Otherwise, if value is a number, then set value to its canonical lexical form as defined in the section Data Round Tripping. If datatype is null, set it to either xsd:integer or xsd:double, depending on if the value contains a fractional and/or an exponential component.
2828
lit = RDF::Literal.new(value, canonicalize: true)
2929
value = lit.to_s

spec/resource_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
end
4141

4242
describe "#hash" do
43-
specify {expect(subject.hash).to be_a(Fixnum)}
43+
specify {expect(subject.hash).to be_a(Integer)}
4444

4545
it "returns the hash of the attributes" do
4646
expect(subject.hash).to eq subject.deresolve.hash

0 commit comments

Comments
 (0)