Class: PnoteClient::Documents::Hml::Char
- Inherits:
-
Object
- Object
- PnoteClient::Documents::Hml::Char
- Defined in:
- lib/pnote_client/documents/hml/char.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Class Method Summary collapse
-
.from_tag(char_tag) ⇒ Object
Textable Element.
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(text) ⇒ Char
constructor
A new instance of Char.
- #textable? ⇒ Boolean
Constructor Details
#initialize(text) ⇒ Char
Returns a new instance of Char.
13 14 15 |
# File 'lib/pnote_client/documents/hml/char.rb', line 13 def initialize(text) @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
11 12 13 |
# File 'lib/pnote_client/documents/hml/char.rb', line 11 def text @text end |
Class Method Details
.from_tag(char_tag) ⇒ Object
Textable Element
7 8 9 |
# File 'lib/pnote_client/documents/hml/char.rb', line 7 def self.from_tag(char_tag) return self.new(char_tag.content) end |
Instance Method Details
#content ⇒ Object
17 18 19 20 21 |
# File 'lib/pnote_client/documents/hml/char.rb', line 17 def content # 일반 텍스트는 변환작업을 하지 않지만 # 닮음기호는 예외 상황으로 처리 @text.gsub(/\xf3\xb0\x81\x80/, "$\\backsim$") end |
#textable? ⇒ Boolean
23 24 25 |
# File 'lib/pnote_client/documents/hml/char.rb', line 23 def textable? return true end |