Class: ANSI::Chain
- Inherits:
-
Object
- Object
- ANSI::Chain
- Defined in:
- lib/ansi/chain.rb
Overview
ANSI::Chain was inspired by Kazuyoshi Tlacaelel’s Isna library.
Instance Attribute Summary collapse
-
#codes ⇒ Object
readonly
Returns the value of attribute codes.
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(string) ⇒ Chain
constructor
A new instance of Chain.
- #method_missing(s, *a, &b) ⇒ Object
- #to_s ⇒ Object
- #to_str ⇒ Object
Constructor Details
#initialize(string) ⇒ Chain
Returns a new instance of Chain.
10 11 12 13 |
# File 'lib/ansi/chain.rb', line 10 def initialize(string) @string = string.to_s @codes = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Attribute Details
#codes ⇒ Object (readonly)
Returns the value of attribute codes.
19 20 21 |
# File 'lib/ansi/chain.rb', line 19 def codes @codes end |
#string ⇒ Object (readonly)
Returns the value of attribute string.
16 17 18 |
# File 'lib/ansi/chain.rb', line 16 def string @string end |