Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Formatting and naming.

  • Loading branch information...
commit 8388a5bd89a807542f28c88da441d5ef6ef7a662 1 parent a917bb6
@jnunemaker jnunemaker authored
Showing with 7 additions and 6 deletions.
  1. +7 −6 lib/plucky/query.rb
View
13 lib/plucky/query.rb
@@ -119,11 +119,11 @@ def fields(*args)
end
def ignore(*args)
- set_fields(args, 0)
+ set_field_inclusion(args, 0)
end
def only(*args)
- set_fields(args, 1)
+ set_field_inclusion(args, 1)
end
def limit(count=nil)
@@ -220,10 +220,11 @@ def inspect
end
private
- def set_fields(field_list, value)
- the_fields = {}
- field_list.each {|field| the_fields[field.to_sym] = value}
- clone.tap { |query| query.options[:fields] = the_fields}
+
+ def set_field_inclusion(fields, value)
+ fields_option = {}
+ fields.each { |field| fields_option[field.to_sym] = value }
+ clone.tap { |query| query.options[:fields] = fields_option }
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.