Class: PinYin::Value
- Inherits:
-
String
- Object
- String
- PinYin::Value
- Defined in:
- lib/ruby-pinyin/value.rb
Instance Attribute Summary collapse
-
#english ⇒ Object
(also: #english?)
Returns the value of attribute english.
Instance Method Summary collapse
-
#initialize(str, english = true) ⇒ Value
constructor
A new instance of Value.
- #split(*args) ⇒ Object
Constructor Details
#initialize(str, english = true) ⇒ Value
Returns a new instance of Value.
6 7 8 9 |
# File 'lib/ruby-pinyin/value.rb', line 6 def initialize(str, english=true) super(str) self.english = english end |
Instance Attribute Details
#english ⇒ Object Also known as: english?
Returns the value of attribute english.
3 4 5 |
# File 'lib/ruby-pinyin/value.rb', line 3 def english @english end |
Instance Method Details
#split(*args) ⇒ Object
11 12 13 14 |
# File 'lib/ruby-pinyin/value.rb', line 11 def split(*args) result = super result.map {|str| self.class.new(str, english)} end |