diff --git a/Gemfile.lock b/Gemfile.lock index 8a05df5..e147a3f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - json_schematize (0.4.0) + json_schematize (0.5.0) GEM remote: https://rubygems.org/ diff --git a/lib/json_schematize/introspect.rb b/lib/json_schematize/introspect.rb index 75fba63..a6a870a 100644 --- a/lib/json_schematize/introspect.rb +++ b/lib/json_schematize/introspect.rb @@ -22,6 +22,7 @@ def deep_inspect(with_raw_params: false, with_field: false) end def inspect - "#<#{self.class} - required fields: #{self.class.required_fields.map(&:name)}; optional fields: #{self.class.optional_fields.map(&:name)}>" + stringify = to_h.map { |k, v| "#{k}:#{v}" }.join(", ") + "#<#{self.class} - required fields: #{self.class.required_fields.map(&:name)}; #{stringify}>" end end diff --git a/lib/json_schematize/version.rb b/lib/json_schematize/version.rb index 45080fa..d36b38b 100644 --- a/lib/json_schematize/version.rb +++ b/lib/json_schematize/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module JsonSchematize - VERSION = "0.5.0" + VERSION = "0.5.1" end diff --git a/spec/lib/json_schematize/generator_spec.rb b/spec/lib/json_schematize/generator_spec.rb index f5e9ecd..485da8c 100644 --- a/spec/lib/json_schematize/generator_spec.rb +++ b/spec/lib/json_schematize/generator_spec.rb @@ -220,7 +220,7 @@ class IntrospectKlassInspect < described_class end IntrospectKlassInspect end - let(:expected) { "#<#{klass} - required fields: #{params.keys}; optional fields: []>" } + let(:expected) { "#<#{klass} - required fields: #{params.keys}; #{instance.to_h.map { |k, v| "#{k}:#{v}" }.join(", ")}>" } it { is_expected.to eq(expected) } end end