Class: TwitterCldr::Transforms::Transforms::TransformPair
- Inherits:
-
Object
- Object
- TwitterCldr::Transforms::Transforms::TransformPair
- Defined in:
- lib/twitter_cldr/transforms/transforms/transform_pair.rb
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
-
#transform ⇒ Object
readonly
Returns the value of attribute transform.
Instance Method Summary collapse
- #apply_to(cursor) ⇒ Object
- #blank? ⇒ Boolean
- #has_filter? ⇒ Boolean
- #has_transform? ⇒ Boolean
-
#initialize(filter, transform) ⇒ TransformPair
constructor
A new instance of TransformPair.
- #null? ⇒ Boolean
Constructor Details
#initialize(filter, transform) ⇒ TransformPair
Returns a new instance of TransformPair.
13 14 15 16 |
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 13 def initialize(filter, transform) @filter = filter @transform = transform end |
Instance Attribute Details
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
11 12 13 |
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 11 def filter @filter end |
#transform ⇒ Object (readonly)
Returns the value of attribute transform.
11 12 13 |
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 11 def transform @transform end |
Instance Method Details
#apply_to(cursor) ⇒ Object
26 27 28 29 |
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 26 def apply_to(cursor) cursor.set_text(rule_set.transform(cursor.text)) cursor.reset_position end |
#blank? ⇒ Boolean
35 36 37 |
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 35 def blank? false end |
#has_filter? ⇒ Boolean
22 23 24 |
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 22 def has_filter? filter && !filter.empty? end |
#has_transform? ⇒ Boolean
18 19 20 |
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 18 def has_transform? transform && !transform.empty? end |
#null? ⇒ Boolean
31 32 33 |
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 31 def null? false end |