class Ransack::Nodes::Node
Attributes
context[R]
Public Class Methods
i18n_alias(opts = {})
click to toggle source
# File lib/ransack/nodes/node.rb, line 16 def i18n_alias(opts = {}) self.i18n_aliases.merge! Hash[opts.map { |k, v| [k.to_s, v.to_s] }] end
i18n_word(*args)
click to toggle source
# File lib/ransack/nodes/node.rb, line 12 def i18n_word(*args) self.i18n_words += args.map(&:to_s) end
new(context)
click to toggle source
# File lib/ransack/nodes/node.rb, line 21 def initialize(context) @context = context end
Public Instance Methods
translate(key, options = {})
click to toggle source
# File lib/ransack/nodes/node.rb, line 25 def translate(key, options = {}) key = i18n_aliases[key.to_s] if i18n_aliases.has_key?(key.to_s) if i18n_words.include?(key.to_s) Translate.word(key) end end