Module: Sequel::Plugins::ForceEncoding::ClassMethods

Defined in:
lib/sequel/lib/sequel/plugins/force_encoding.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#forced_encodingObject

Returns the value of attribute forced_encoding


30
31
32
# File 'lib/sequel/lib/sequel/plugins/force_encoding.rb', line 30

def forced_encoding
  @forced_encoding
end

Instance Method Details

#inherited(subclass) ⇒ Object


33
34
35
36
# File 'lib/sequel/lib/sequel/plugins/force_encoding.rb', line 33

def inherited(subclass)
  super
  subclass.forced_encoding = forced_encoding
end

#load(row) ⇒ Object


40
41
42
43
# File 'lib/sequel/lib/sequel/plugins/force_encoding.rb', line 40

def load(row)
  row.values.each{|v| v.force_encoding(forced_encoding) if v.is_a?(String)} if forced_encoding
  super
end