Sha256: e66fb02b7d6c83deab0080d1948aa55d6797dfe940e34223dc8e674345fbfc68
Contents?: true
Size: 1007 Bytes
Versions: 28
Compression:
Stored size: 1007 Bytes
Contents
# encoding: UTF-8 # Copyright 2012 Twitter, Inc # http://www.apache.org/licenses/LICENSE-2.0 module TwitterCldr module Transforms module Transforms class NamedTransform < TransformRule Transformer = TwitterCldr::Transforms::Transformer class << self def accepts?(forward_form, backward_form) exists?(forward_form) && exists?(backward_form) end private def exists?(form) !form || form.null? || form.blank? || Transformer.exists?(form.transform) end end def apply_to(cursor) if forward_form puts forward_form.transform if $debug forward_form.apply_to(cursor) end end private def after_initialize if forward_form @backward_form ||= TransformPair.new( nil, TransformId.parse(forward_form.transform).reverse.to_s ) end end end end end end
Version data entries
28 entries across 28 versions & 1 rubygems