Skip to content

Commit

Permalink
Adjust comments to use 1.9 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
rwz committed Sep 15, 2013
1 parent d02f290 commit 0de0e39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/jbuilder.rb
Expand Up @@ -125,7 +125,7 @@ def set!(key, value = BLANK, *args, &block)
#
# You can pass parameters to the method using a hash pair.
#
# json.key_format! :camelize => :lower
# json.key_format! camelize: :lower
# json.first_name "David"
#
# { "firstName": "David" }
Expand Down Expand Up @@ -237,17 +237,17 @@ def array!(collection, *attributes, &block)
#
# Example:
#
# @person = Struct.new(:name, :age).new("David", 32)
# @person = Struct.new(:name, :age).new('David', 32)
#
# or you can utilize a Hash
#
# @person = {:name => "David", :age => 32}
# @person = { name: 'David', age: 32 }
#
# json.extract! @person, :name, :age
#
# { "name": David", "age": 32 }, { "name": Jamie", "age": 31 }
#
# If you are using Ruby 1.9+, you can use the call syntax instead of an explicit extract! call:
# You can also use the call syntax instead of an explicit extract! call:
#
# json.(@person, :name, :age)
def extract!(object, *attributes)
Expand Down
2 changes: 1 addition & 1 deletion lib/jbuilder/jbuilder_template.rb
Expand Up @@ -43,7 +43,7 @@ def array!(collection, *attributes, &block)
#
# Example:
#
# json.cache! ['v1', @person], :expires_in => 10.minutes do
# json.cache! ['v1', @person], expires_in: 10.minutes do
# json.extract! @person, :name, :age
# end
def cache!(key=nil, options={}, &block)
Expand Down

0 comments on commit 0de0e39

Please sign in to comment.