each_value

hsh.each_value {| value | block } â hshhsh.each_value â an_enumerator Instance Public methods Calls block once for each key in hsh, passing the value as a parameter. If no block is given, an enumerator is returned instead. h = { "a" => 100, "b" => 200 } h.each_value {|value| puts value } produces: 100 200

new 2

new(*args, &block) Instance Public methods Initializes new record from relation while maintaining the current scope. Expects arguments in the same format as Base.new. users = User.where(name: 'DHH') user = users.new # => #<User id: nil, name: "DHH", created_at: nil, updated_at: nil> You can also pass a block to new with the new record as argument: user = users.new { |user| user.name = 'Oscar' } user.name # => Oscar build

new

new(klass, table, values = {}) Class Public methods

set_numeric_type

set_numeric_type(val) Instance Public methods Also aliased as: numeric_type=

setColor

setColor(w,button,name,options) Instance Public methods

hierarchical?

hierarchical?() Instance Public methods Checks if URI has a path

sanitize_sql_hash_for_conditions

sanitize_sql_hash_for_conditions(attrs, default_table_name = self.table_name) Instance Protected methods Sanitizes a hash of attribute/value pairs into SQL conditions for a WHERE clause. { name: "foo'bar", group_id: 4 } # => "name='foo''bar' and group_id= 4" { status: nil, group_id: [1,2,3] } # => "status IS NULL and group_id IN (1,2,3)" { age: 13..18 } # => "age BETWEEN 13 AND 18" { 'other_records.id' => 7 } # => "`other_records`.`id` = 7" { other_records: {

method_missing

method_missing(id, *args) Instance Public methods

sanitize_sql_for_conditions

sanitize_sql_for_conditions(condition, table_name = self.table_name) Instance Protected methods Accepts an array, hash, or string of SQL conditions and sanitizes them into a valid SQL fragment for a WHERE clause. ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'" { name: "foo'bar", group_id: 4 } returns "name='foo''bar' and group_id='4'" "name='foo''bar' and group_id='4'" returns "name='foo''bar' and group_id='4'" sanitize_sql

cget

cget(option) Instance Public methods Returns the current value of the configuration option given by option. Example, display name of the file from which image was created: puts image.cget :file