Class: PinYin::Value

Inherits:
String
  • Object
show all
Defined in:
lib/ruby-pinyin/value.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#englishObject 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