Class: TwitterCldr::Transforms::RuleSet
- Inherits:
-
Object
- Object
- TwitterCldr::Transforms::RuleSet
- Defined in:
- lib/twitter_cldr/transforms/rule_set.rb
Instance Attribute Summary collapse
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
-
#transform_id ⇒ Object
readonly
Returns the value of attribute transform_id.
Instance Method Summary collapse
-
#initialize(rules, transform_id) ⇒ RuleSet
constructor
A new instance of RuleSet.
- #invert ⇒ Object
- #transform(text) ⇒ Object
Constructor Details
#initialize(rules, transform_id) ⇒ RuleSet
Returns a new instance of RuleSet.
15 16 17 18 |
# File 'lib/twitter_cldr/transforms/rule_set.rb', line 15 def initialize(rules, transform_id) @rules = partition(rules) @transform_id = transform_id end |
Instance Attribute Details
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
13 14 15 |
# File 'lib/twitter_cldr/transforms/rule_set.rb', line 13 def rules @rules end |
#transform_id ⇒ Object (readonly)
Returns the value of attribute transform_id.
13 14 15 |
# File 'lib/twitter_cldr/transforms/rule_set.rb', line 13 def transform_id @transform_id end |
Instance Method Details
#invert ⇒ Object
26 27 28 29 30 |
# File 'lib/twitter_cldr/transforms/rule_set.rb', line 26 def invert self.class.new( rules.reverse.map(&:invert), transform_id ) end |