Class: TwitterCldr::Transforms::Transforms::TransformPair

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/transforms/transforms/transform_pair.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filterObject (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

#transformObject (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

Returns:

  • (Boolean)

35
36
37
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 35

def blank?
  false
end

#has_filter?Boolean

Returns:

  • (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

Returns:

  • (Boolean)

18
19
20
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 18

def has_transform?
  transform && !transform.empty?
end

#null?Boolean

Returns:

  • (Boolean)

31
32
33
# File 'lib/twitter_cldr/transforms/transforms/transform_pair.rb', line 31

def null?
  false
end