ryo.rb 0.4.6 → 0.4.7

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
  SHA256:
3
- metadata.gz: e90c5b42d1b364a6be77786df22b887017d3ce4965822f7152af7bcb1c617748
4
- data.tar.gz: ec5d807404158d8dd1e9df47ee1fa15fb6be64ae2086942fbe9c1fd834be7331
3
+ metadata.gz: 0dab9ce575cc86bc7fc740dc72d1a1c416a22d36ed8806b86e1c7f60c0b46f5b
4
+ data.tar.gz: 403f51fb967e4c745461a61092984f78de8fac139465da0442cd30dea66c807d
5
5
  SHA512:
6
- metadata.gz: ef8f408777db206d7fa5e3c7ced8d8a5fdfdaa15ad6e39f25921de20c421f0bef90d1aa1e474cbc6f6ab23d17fa314bd6513d3b9e322732d4adf21fb6c76b9c9
7
- data.tar.gz: db93fad9aa4eeffdecbba86fa2ec970851eb007d3fecf0602e631584091f28d06dd3997464306267012bf893319f5209813b8cb99024e0281a5048da39f2a0a5
6
+ metadata.gz: dcac875bbd985395ffa37b1b3c48e9f52ebd11d36514faf75e18134530fc2599fbac437114d3d9c2530a66aec810cc7de8904355467a9854d9a9b4f80f2c63f6
7
+ data.tar.gz: bbb67ac56137b8989b8c94f82b20c887d3914d7218170ded3688e8f53251d2ef1808af4a143e469c374951031a1ab40b3f8ed6cf0ce084ee72f078ad2022446f
data/README.md CHANGED
@@ -359,7 +359,7 @@ are available as sources.
359
359
 
360
360
  ```ruby
361
361
  # Gemfile
362
- gem "ryo.rb", github: "0x1eef/ryo.rb", tag: "v0.4.6"
362
+ gem "ryo.rb", github: "0x1eef/ryo.rb", tag: "v0.4.7"
363
363
  ```
364
364
 
365
365
  **Rubygems.org**
data/lib/ryo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ryo
4
- VERSION = "0.4.6"
4
+ VERSION = "0.4.7"
5
5
  end
data/lib/ryo.rb CHANGED
@@ -158,6 +158,7 @@ module Ryo
158
158
  def to_h
159
159
  Ryo.table_of(self, recursive: true)
160
160
  end
161
+ alias_method :to_hash, :to_h
161
162
 
162
163
  ##
163
164
  # @private
@@ -64,5 +64,12 @@ RSpec.describe Ryo::BasicObject do
64
64
  it { expect(h).to be_instance_of(Hash) }
65
65
  it { expect(h["wheels"]).to be_instance_of(Hash) }
66
66
  it { expect(h).to eq({"name" => "ford", "wheels" => {"quantity" => 4}}) }
67
+
68
+ context "when given to Hash#merge" do
69
+ let(:car) { Ryo(name: "ford") }
70
+ subject { {}.merge(car) }
71
+ it { is_expected.to be_instance_of(Hash) }
72
+ it { is_expected.to eq({"name" => "ford"})}
73
+ end
67
74
  end
68
75
  end
@@ -59,6 +59,13 @@ RSpec.describe "Ryo objects" do
59
59
  it { expect(h).to be_instance_of(Hash) }
60
60
  it { expect(h["wheels"]).to be_instance_of(Hash) }
61
61
  it { expect(h).to eq({"name" => "ford", "wheels" => {"quantity" => 4}}) }
62
+
63
+ context "when given to Hash#merge" do
64
+ let(:car) { Ryo(name: "ford") }
65
+ subject { {}.merge(car) }
66
+ it { is_expected.to be_instance_of(Hash) }
67
+ it { is_expected.to eq({"name" => "ford"})}
68
+ end
62
69
  end
63
70
 
64
71
  describe "when a property overshadows a method" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ryo.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - '0x1eef'