object_identifier 0.0.6 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +11 -0
  3. data/.travis.yml +21 -0
  4. data/CHANGELOG.md +10 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +51 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +82 -48
  9. data/Rakefile +6 -28
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/lib/object_identifier/core_ext/big_decimal.rb +4 -2
  13. data/lib/object_identifier/core_ext/object.rb +6 -7
  14. data/lib/object_identifier/core_ext/string.rb +6 -6
  15. data/lib/object_identifier/core_ext/symbol.rb +2 -2
  16. data/lib/object_identifier/identifier.rb +59 -59
  17. data/lib/object_identifier/version.rb +1 -1
  18. data/lib/object_identifier.rb +4 -5
  19. data/object_identifier.gemspec +40 -0
  20. metadata +105 -109
  21. data/MIT-LICENSE +0 -20
  22. data/lib/object_identifier/deidentifier.rb +0 -78
  23. data/test/core_ext/big_decimal_test.rb +0 -12
  24. data/test/core_ext/object_test.rb +0 -11
  25. data/test/core_ext/string_test.rb +0 -9
  26. data/test/core_ext/symbol_test.rb +0 -9
  27. data/test/deidentifier_test.rb +0 -28
  28. data/test/dummy/README.rdoc +0 -28
  29. data/test/dummy/Rakefile +0 -6
  30. data/test/dummy/app/assets/javascripts/application.js +0 -13
  31. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  32. data/test/dummy/app/controllers/application_controller.rb +0 -5
  33. data/test/dummy/app/helpers/application_helper.rb +0 -2
  34. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  35. data/test/dummy/bin/bundle +0 -3
  36. data/test/dummy/bin/rails +0 -4
  37. data/test/dummy/bin/rake +0 -4
  38. data/test/dummy/config/application.rb +0 -23
  39. data/test/dummy/config/boot.rb +0 -5
  40. data/test/dummy/config/database.yml +0 -25
  41. data/test/dummy/config/environment.rb +0 -5
  42. data/test/dummy/config/environments/development.rb +0 -29
  43. data/test/dummy/config/environments/production.rb +0 -80
  44. data/test/dummy/config/environments/test.rb +0 -36
  45. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  46. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  47. data/test/dummy/config/initializers/inflections.rb +0 -16
  48. data/test/dummy/config/initializers/mime_types.rb +0 -5
  49. data/test/dummy/config/initializers/secret_token.rb +0 -12
  50. data/test/dummy/config/initializers/session_store.rb +0 -3
  51. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  52. data/test/dummy/config/locales/en.yml +0 -23
  53. data/test/dummy/config/routes.rb +0 -56
  54. data/test/dummy/config.ru +0 -4
  55. data/test/dummy/db/test.sqlite3 +0 -0
  56. data/test/dummy/log/development.log +0 -0
  57. data/test/dummy/log/test.log +0 -0
  58. data/test/dummy/public/404.html +0 -58
  59. data/test/dummy/public/422.html +0 -58
  60. data/test/dummy/public/500.html +0 -57
  61. data/test/dummy/public/favicon.ico +0 -0
  62. data/test/object_identifier_test.rb +0 -70
  63. data/test/test_helper.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 89be2d486507ddbd5182f7fb39bcfcd9afaa6a18
4
- data.tar.gz: 9b6da56732eb50db9e65ae9f70364d4a64173650
2
+ SHA256:
3
+ metadata.gz: 15ea208b08827813706ca4351a58709ec064d4ba9ad365084c6ef954daf40148
4
+ data.tar.gz: 9044d50b67314cd0a7da45d27874acf807fc13829fd0ef5f10eb5d1a0a3f23c6
5
5
  SHA512:
6
- metadata.gz: f6649983366ea699aa1f1ae45645b22cb3304a3f8f6a561f73e15a330a73222b084cc664f2cbb43790e6d0fd09b36b93eeaebb843a0a966f60d6ec717c208cca
7
- data.tar.gz: 8f250fed936c1c3f2f22473832af284c389f5ce013a0de36203739df57200e779b04d2cdd8bceed85606faa8963e705e6b8c32f969ec6d85c9d9336eac2cf79a
6
+ metadata.gz: 79481c060a1469918bf2e4e9ebcc99f469132ded28794b1ef5cb6944e3a39159052db3a87a323f605e786efeb71ae10fafa2c6f37ea286517d6a595536d74597
7
+ data.tar.gz: 20e1a1255476b06f0f5a9804daec02703b7c7d913f401b38fd6d632df7327df74c74ba784e380881d2b6938a10bc51d73104f1ebe16cd5a1e043503d0e703f65
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ .byebug_history
10
+ *.gem
11
+ .DS_Store
data/.travis.yml ADDED
@@ -0,0 +1,21 @@
1
+ env:
2
+ global:
3
+ - CC_TEST_REPORTER_ID=3b57e55dcd3cc40ee073715e7d75fa80ab7b7687cb8a420eac500d27b5cb28db
4
+ sudo: false
5
+ language: ruby
6
+ rvm:
7
+ - 2.2.10
8
+ - 2.3.7
9
+ - 2.4.4
10
+ - 2.5.1
11
+ - ruby-head
12
+ notifications:
13
+ email: false
14
+ before_install: gem install bundler -v 1.16.1
15
+ cache: bundler
16
+ before_script:
17
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
18
+ - chmod +x ./cc-test-reporter
19
+ - ./cc-test-reporter before-build
20
+ after_script:
21
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
data/CHANGELOG.md ADDED
@@ -0,0 +1,10 @@
1
+ ### 0.1.0 - 2018-04-14
2
+
3
+ * Revamp gem
4
+ * Update gem dependencies
5
+ * Now returns "[no objects]" even if given a :klass option
6
+
7
+
8
+ ### 0.0.6 - 2016-02-06
9
+
10
+ * Fix: identify method now supports private & protected methods
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in object_identifier.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,51 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ object_identifier (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ansi (1.5.0)
10
+ builder (3.2.3)
11
+ byebug (10.0.2)
12
+ coderay (1.1.2)
13
+ docile (1.3.0)
14
+ json (2.1.0)
15
+ method_source (0.9.0)
16
+ minitest (5.4.1)
17
+ minitest-reporters (1.2.0)
18
+ ansi
19
+ builder
20
+ minitest (>= 5.0)
21
+ ruby-progressbar
22
+ pry (0.11.3)
23
+ coderay (~> 1.1.0)
24
+ method_source (~> 0.9.0)
25
+ pry-byebug (3.6.0)
26
+ byebug (~> 10.0)
27
+ pry (~> 0.10)
28
+ rake (10.3.2)
29
+ ruby-progressbar (1.9.0)
30
+ simplecov (0.16.1)
31
+ docile (~> 1.1)
32
+ json (>= 1.8, < 3)
33
+ simplecov-html (~> 0.10.0)
34
+ simplecov-html (0.10.2)
35
+
36
+ PLATFORMS
37
+ ruby
38
+
39
+ DEPENDENCIES
40
+ bundler (~> 1.16)
41
+ byebug (~> 10.0)
42
+ minitest (~> 5.0)
43
+ minitest-reporters (~> 1.2)
44
+ object_identifier!
45
+ pry (~> 0.11)
46
+ pry-byebug (~> 3.6)
47
+ rake (~> 10.0)
48
+ simplecov (~> 0.16)
49
+
50
+ BUNDLED WITH
51
+ 1.16.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Paul Dobbins
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # Object Identifier
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/object_identifier.png)](http://badge.fury.io/rb/object_identifier)
4
+ [![Build Status](https://travis-ci.org/pdobb/object_identifier.svg?branch=master)](https://travis-ci.org/pdobb/object_identifier)
5
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/0b737a72d16ec755c1ff/test_coverage)](https://codeclimate.com/github/pdobb/object_identifier/test_coverage)
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/0b737a72d16ec755c1ff/maintainability)](https://codeclimate.com/github/pdobb/object_identifier/maintainability)
4
7
 
5
- Object Identifier allows quick, easy, and uniform identification of an object by inspecting its class name and outputting any desirable attributes/methods. This is great for quickly logging, sending more descriptive notifications, or any other purpose.
8
+ Object Identifier allows quick, easy, and uniform identification of an object by inspecting its class name and outputting any desirable attributes/methods. It is great for quickly logging, sending descriptive notification messages, etc.
6
9
 
7
10
  For example:
8
11
 
@@ -17,117 +20,148 @@ Which is the same as:
17
20
  ```
18
21
 
19
22
 
20
- ## Compatibility
21
-
22
- * Ruby: MRI 1.9.3+
23
- * Ruby: MRI 2+
24
- * Rails: 3+
25
-
26
-
27
23
  ## Installation
28
24
 
29
25
  Add this line to your application's Gemfile:
30
26
 
31
27
  ```ruby
32
- gem 'object_identifier'
28
+ gem "object_identifier"
33
29
  ```
34
30
 
35
31
  And then execute:
36
32
 
37
- ```ruby
38
- bundle
39
- ```
33
+ $ bundle
34
+
35
+ Or install it yourself as:
36
+
37
+ $ gem install object_identifier
38
+
39
+
40
+ ## Compatibility
41
+
42
+ Tested MRI Ruby Versions:
43
+ * 2.2.10
44
+ * 2.3.7
45
+ * 2.4.4
46
+ * 2.5.1
47
+ * edge
40
48
 
41
49
 
42
50
  ## Usage
43
51
 
44
52
  ### Defaults
45
53
 
46
- Outputs the `id` attribute by default, if possible and if no other attributes
47
- are given:
54
+ `identify` outputs the `id` of the receiving object by default, if it exists and no other attributes/methods are specified.
48
55
 
49
56
  ```ruby
50
- some_object.identify # => Movie[id:1]
57
+ my_movie.identify # => Movie[id:1]
58
+ my_movie.identify(:rating) # => Movie[rating:"7/10"]
51
59
  ```
52
60
 
53
- Also works with methods:
61
+ Private methods can be identified just the same as public methods.
54
62
 
55
63
  ```ruby
56
- some_object.identify(:get_rating) # => Movie[get_rating:"7/10"]
64
+ my_movie.identify(:my_private_method) # => Movie[my_private_method:"Shh"]
57
65
  ```
58
66
 
67
+
59
68
  ### Unknown Attributes/Methods
60
69
 
61
- If the object doesn't respond to a specified attribute/method it is simply
62
- ignored:
70
+ If the object doesn't respond to a specified attribute/method it is simply ignored:
63
71
 
64
72
  ```ruby
65
- some_object.identify(:gobble_gobble, :id) # => Movie[id:1]
73
+ my_movie.identify(:gobble_gobble, :rating) # => Movie[rating:"7/10"]
66
74
  ```
67
75
 
68
- ### Collections
76
+ ### Overriding Class Names
77
+
78
+ ```ruby
79
+ my_delayed_job.identify(klass: "Delayed::Job") # => Delayed::Job[id:1]
80
+ my_movie.identify(klass: nil) # => [id:1]
81
+ ```
69
82
 
70
- Works great with collections:
83
+
84
+ ### Identifying Nil
71
85
 
72
86
  ```ruby
73
- [some_object, some_other_object].identify(:id, :name)
74
- # => Movie[id:1, name:"Pi"], Contact[id:23, name:"Bob"]
87
+ nil.identify(:id, :name) # => [no objects]
88
+ nil.identify(:id, :name, klass: "Nope") # => [no objects]
75
89
  ```
76
90
 
77
- Also allows limiting of results:
91
+
92
+ ### Collections
93
+
94
+ Collections of objects are each identified in turn.
78
95
 
79
96
  ```ruby
80
- [some_object, some_other_object].identify(:id, :name, limit: 1)
81
- # => Movie[id:1, name:"Pi"], ... (1 more)
97
+ [my_movie, my_user].identify(:id, :name)
98
+ # => Movie[id:1, name:"Pi"], User[id:1, name:"Bob"]
82
99
  ```
83
100
 
84
- ### Overriding the Class Name
101
+ The number of results that will be identified from a collection can be truncated by specifying the `limit` option.
85
102
 
86
103
  ```ruby
87
- some_object.identify(klass: "MyMovie") # => MyMovie[id:1]
88
- some_object.identify(klass: nil) # => [id:1]
89
- delayed_job.identify(klass: "Delayed::Job") # => Delayed::Job[id:1]
104
+ [my_movie, my_contact].identify(:id, :name, limit: 1)
105
+ # => Movie[id:1, name:"Pi"], ... (1 more)
90
106
  ```
91
107
 
92
- ### Nils and Empty Collections
108
+
109
+ ### Empty Collections
93
110
 
94
111
  ```ruby
95
- nil.identify(:id, :name) # => [no objects]
96
- [].identify # => [no objects]
112
+ [].identify # => [no objects]
113
+ {}.identify # => [no objects]
97
114
  ```
98
115
 
99
116
 
100
117
  ## Custom Object Identifiers
101
118
 
102
- Internally, Object Identifier relies on a method named `inspect_lit` to return a "literally-inspected" string representation of all objects being identified. For example:
119
+ Internally, Object Identifier calls `inspect_lit` to return a "literally-inspected" string representation of an object. This works because Object, itself, is monkey-patched to define `inspect_lit` which just returns `inspect`. This is sufficient for most objects, but some objects will benefit from defining special output from `inspect_lit`.
120
+
121
+ Object Identifier defines `inspect_lit` on three other core objects: String, Symbol, and BigDecimal.
103
122
 
104
123
  ```ruby
105
- :a_symbol.respond_to?(:inspect_lit) # => true
106
- :a_symbol.inspect_lit # => ":\"a_symbol\""
107
- "a_string".inspect_lit # => "\"a_string\""
108
- BigDecimal(1.99, 3).inspect_lit # => "<BD:1.99>"
124
+ "a_string".inspect_lit # => "\"a_string\""
125
+ :a_symbol.inspect_lit # => ":\"a_symbol\""
126
+ BigDecimal(1.99, 3).inspect_lit # => "<BD:1.99>"
109
127
  ```
110
128
 
111
- Therefore, if you'd like to represent a custom object in a special way for object identification, just define the to-string conversion within the `inspect_lit` method.
112
-
129
+ To identify an object in a special way, just define `inspect_lit` to return a custom String.
113
130
 
114
131
  ```ruby
115
- class MyVal
132
+ class MyValueObject
116
133
  def initialize(val)
117
134
  @val = val
118
135
  end
119
136
 
120
137
  def inspect_lit
121
- "<MOO:#{@val}>"
138
+ "#{@val} Meters"
122
139
  end
123
140
  end
124
141
 
125
- OpenStruct.new(my_val: MyVal.new(42)).identify(:my_val)
126
- # => "OpenStruct[my_val:<MOO:42>]"
142
+ my_value_object = MyValueObject.new(42)
143
+ OpenStruct.new(my_value: my_value_object).identify(:my_value)
144
+ # => "OpenStruct[my_value:42 Meters]"
127
145
  ```
128
146
 
129
147
 
130
- ## Authors
148
+ ## Supporting Gems
149
+
150
+ ObjectIdentifier works great with the [ObjectInspector](https://github.com/pdobb/object_inspector) gem.
151
+
152
+
153
+ ## Development
154
+
155
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
156
+
157
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
158
+
159
+
160
+ ## Contributing
161
+
162
+ Bug reports and pull requests are welcome on GitHub at https://github.com/pdobb/object_identifier.
163
+
164
+
165
+ ## License
131
166
 
132
- - Paul Dobbins
133
- - Evan Sherwood
167
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -1,32 +1,10 @@
1
- begin
2
- require 'bundler/setup'
3
- rescue LoadError
4
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
- end
6
-
7
- require 'rdoc/task'
8
-
9
- RDoc::Task.new(:rdoc) do |rdoc|
10
- rdoc.rdoc_dir = 'rdoc'
11
- rdoc.title = 'ObjectIdentifier'
12
- rdoc.options << '--line-numbers'
13
- rdoc.rdoc_files.include('README.rdoc')
14
- rdoc.rdoc_files.include('lib/**/*.rb')
15
- end
16
-
17
-
18
-
19
-
20
- Bundler::GemHelper.install_tasks
21
-
22
- require 'rake/testtask'
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
23
3
 
24
4
  Rake::TestTask.new(:test) do |t|
25
- t.libs << 'lib'
26
- t.libs << 'test'
27
- t.pattern = 'test/**/*_test.rb'
28
- t.verbose = false
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
29
8
  end
30
9
 
31
-
32
- task default: :test
10
+ task :default => :test
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "object_identifier"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ require "pry"
11
+ Pry.start
12
+
13
+ # require "irb"
14
+ # IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -1,11 +1,13 @@
1
+ require "bigdecimal"
2
+
1
3
  class BigDecimal
2
4
  # Formats this BigDecimal as an object-type-revealing String.
3
5
  #
4
6
  # @return [String] a String representation of this BigDecimal object
5
7
  #
6
8
  # @example
7
- # BigDecimal.new(1).inspect_lit # => "<BD:1.0>"
8
- # BigDecimal.new(99.999, 5).inspect_lit # => "<BD:99.999>"
9
+ # BigDecimal.new(1).inspect_lit # => "<BD:1.0>"
10
+ # BigDecimal.new(99.999, 5).inspect_lit # => "<BD:99.999>"
9
11
  def inspect_lit
10
12
  "<BD:#{self}>"
11
13
  end
@@ -1,9 +1,8 @@
1
1
  class Object
2
2
  # Standard #inspect for any object that doesn't override this method. This
3
- # method is meant to make an object's type inherently obvious when used in
4
- # logging methods, etc.
3
+ # method is meant to make an object's type inherently obvious inspected.
5
4
  #
6
- # @return [String] a string representation of this object
5
+ # @return [String] a String-literal representation of this object
7
6
  def inspect_lit
8
7
  inspect
9
8
  end
@@ -20,23 +19,23 @@ class Object
20
19
  # @param [Hash] options the options for building a customized
21
20
  # self-identifier
22
21
  # @option options [String, nil] :klass object class name override
23
- # @option options [Fixnum] :limit maximum number of objects to display from
22
+ # @option options [Integer] :limit maximum number of objects to display from
24
23
  # a collection
25
24
  #
26
- # @return [String] a self-identifying string like `Class[id:1, name:'temp']`
25
+ # @return [String] a self-identifying string
27
26
  #
28
27
  # @example
29
28
  # OpenStruct.new(a: 1, b: '2', c: :"3").identify(:a, :b, :c)
30
29
  # # => "OpenStruct[a:1, b:\"2\", c::\"3\"]"
31
30
  #
32
- # 1.identify(:to_s) # => "Fixnum[to_s:\"1\"]"
31
+ # 1.identify(:to_s) # => "Integer[to_s:\"1\"]"
33
32
  # nil.identify # => "[no objects]"
34
33
  #
35
34
  # %w(1 2 3).identify(:to_i, :to_f)
36
35
  # # => "String[to_i:1, to_f:1.0], String[to_i:2, to_f:2.0], String[to_i:3, to_f:3.0]"
37
36
  #
38
37
  # (1..10).to_a.identify(:to_f, limit: 2)
39
- # # => "Fixnum[to_f:1.0], Fixnum[to_f:2.0], ... (8 more)"
38
+ # # => "Integer[to_f:1.0], Integer[to_f:2.0], ... (8 more)"
40
39
  def identify(*args)
41
40
  ObjectIdentifier::Identifier.identify(self, *args)
42
41
  end
@@ -1,13 +1,13 @@
1
1
  class String
2
- # Formats this string to look like a string literal so that object type will
3
- # be inherently obvious when used in logging methods, etc.
2
+ # Formats self to look like a String literal so that object type will be
3
+ # inherently obvious when inspected.
4
4
  #
5
- # @return [String] a string literal representation of this object
5
+ # @return [String] a String-literal representation of this object
6
6
  #
7
7
  # @example
8
- # "test".inspect_lit # => "\"test\"" (or '"test"')
9
- # "1".inspect_lit # => "\"1\"" (or '"1"')
10
- # "12.3".inspect_lit # => "\"12.3\"" (or '"12.3"')
8
+ # "test".inspect_lit # => "\"test\"" (i.e. '"test"')
9
+ # "1".inspect_lit # => "\"1\"" (i.e. '"1"')
10
+ # "12.3".inspect_lit # => "\"12.3\"" (i.e. '"12.3"')
11
11
  def inspect_lit
12
12
  %("#{to_s}")
13
13
  end
@@ -5,8 +5,8 @@ class Symbol
5
5
  # @return [String] a symbol literal representation of this object
6
6
  #
7
7
  # @example
8
- # :test.inspect_lit # => ":\"test\"" (or ':"test"')
9
- # :"ta-da!".inspect_lit # => ":\"ta-da!\"" (or ':"ta-da!"')
8
+ # :test.inspect_lit # => ":\"test\"" (or ':"test"')
9
+ # :"ta-da!".inspect_lit # => ":\"ta-da!\"" (or ':"ta-da!"')
10
10
  def inspect_lit
11
11
  %(:"#{to_s}")
12
12
  end