Sha256: 2f267d4d3110088c2b1303fdf49d8a1b0dd35c9cadcbaf4848eca3fe0135e94d
Contents?: true
Size: 1.61 KB
Versions: 12
Compression:
Stored size: 1.61 KB
Contents
module Ecoportal module API class V2 class Page class Component class PlainTextField < Page::Component passthrough :value passboolean :multiline passthrough :max_length passboolean :exact_index # Quick config helper # @param conf [Symbol, Array<Symbol>] # - `:multiline` multi line mode # - `:singleline` signle line mode # - `:exact_index` to make the `value` indexed as a **whole** (as opposite to its parts or n-grams) # - `:max_length` specify the maximum length of the `value` def configure(*conf) conf.each_with_object([]) do |cnf, unused| case cnf when :multiline self.multiline = true when :singleline self.multiline = false when :exact_index self.exact_index = true when Hash supported = [:multiline, :max_length] unless (rest = hash_except(cnf.dup, *supported)).empty? unused.push(rest) end if cnf.key?(:multiline) then self.multiline = !!cnf[:multiline] end if cnf.key?(:max_length) then self.max_length = cnf[:max_length] end else unused.push(cnf) end end.yield_self do |unused| super(*unused) end end end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems