Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Do not use one-letter variables #131

Merged
merged 1 commit into from

3 participants

@sheerun

No description provided.

@zzak
Collaborator

If it's any consolation, we can skip changing the method and use a call-seq in the rdoc to give "o" any name we want:

  ###
  #  call-seq:
  #    Psych.to_json object
  #
  # Dump the given Ruby +object+ to a JSON string.
  def self.to_json o
    visitor = Psych::Visitors::JSONTree.new
    visitor << o
    visitor.tree.yaml
  end
@zzak zzak was assigned
@sheerun

This is just silly ;)

@zzak
Collaborator

The problem is that "o" is used for "object" all over the place throughout Psych, so you'd have to change it everywhere if you wanted to be consistent.

@sheerun

Good idea

@tenderlove tenderlove merged commit aa4a9b4 into tenderlove:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 27, 2013
  1. @sheerun
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/psych.rb
View
6 lib/psych.rb
@@ -260,10 +260,10 @@ def self.dump_stream *objects
end
###
- # Dump Ruby object +o+ to a JSON string.
- def self.to_json o
+ # Dump Ruby +object+ to a JSON string.
+ def self.to_json object
visitor = Psych::Visitors::JSONTree.new
- visitor << o
+ visitor << object
visitor.tree.yaml
end
Something went wrong with that request. Please try again.