Class Jpmobile::Filter::Base
In: lib/jpmobile/filter.rb
Parent: Object

文字コードフィルタのベースクラス。

Methods

Public Instance methods

内部コードから外部コードに変換

[Source]

    # File lib/jpmobile/filter.rb, line 37
37:       def after(controller)
38:         if respond_to?(:to_external) && apply_outgoing?(controller) && controller.response.body.is_a?(String)
39:           controller.response.body = to_external(controller.response.body, controller)
40:           after_after(controller) if respond_to? :after_after
41:         end
42:       end

入力時(params)にこのフィルタを適用するか

[Source]

    # File lib/jpmobile/filter.rb, line 44
44:       def apply_incoming?(controller); true; end

出力時(response.body)にこのフィルタを適用するべきか

[Source]

    # File lib/jpmobile/filter.rb, line 46
46:       def apply_outgoing?(controller); true; end

外部コードから内部コードに変換

[Source]

    # File lib/jpmobile/filter.rb, line 29
29:       def before(controller)
30:         if respond_to?(:to_internal) && apply_incoming?(controller)
31:           Util.deep_apply(controller.params) do |value|
32:             value = to_internal(value, controller)
33:           end
34:         end
35:       end

[Validate]