Class Index [+]

Quicksearch

Sequel::Plugins::ForceEncoding::InstanceMethods

Public Instance Methods

merge_db_update(row) click to toggle source

Allow the force encoding plugin to work with the identity_map plugin by typecasting new values.

    # File lib/sequel/plugins/force_encoding.rb, line 45
45:         def merge_db_update(row)
46:           super(force_hash_encoding(row))
47:         end
set_values(row) click to toggle source

Force the encoding of all string values when setting the instance’s values.

    # File lib/sequel/plugins/force_encoding.rb, line 50
50:         def set_values(row)
51:           super(force_hash_encoding(row))
52:         end

Private Instance Methods

force_hash_encoding(row) click to toggle source

Force the encoding for all string values in the given row hash.

    # File lib/sequel/plugins/force_encoding.rb, line 57
57:         def force_hash_encoding(row)
58:           fe = model.forced_encoding
59:           row.values.each{|v| v.force_encoding(fe) if v.is_a?(String)} if fe
60:           row
61:         end
typecast_value(column, value) click to toggle source

Force the encoding of all returned strings to the model’s forced_encoding.

    # File lib/sequel/plugins/force_encoding.rb, line 64
64:         def typecast_value(column, value)
65:           s = super
66:           s.force_encoding(model.forced_encoding) if s.is_a?(String) && model.forced_encoding
67:           s
68:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.