Class: TmxParser::Placeholder
- Inherits:
-
Object
- Object
- TmxParser::Placeholder
- Defined in:
- lib/tmx-parser/elements.rb
Instance Attribute Summary collapse
-
#length ⇒ Object
Returns the value of attribute length.
-
#start ⇒ Object
Returns the value of attribute start.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other_placeholder) ⇒ Object
- #copy ⇒ Object
-
#initialize(type, text = '') ⇒ Placeholder
constructor
A new instance of Placeholder.
- #receive_text(str) ⇒ Object
Constructor Details
#initialize(type, text = '') ⇒ Placeholder
Returns a new instance of Placeholder.
91 92 93 94 |
# File 'lib/tmx-parser/elements.rb', line 91 def initialize(type, text = '') @type = type @text = text end |
Instance Attribute Details
#length ⇒ Object
Returns the value of attribute length.
89 90 91 |
# File 'lib/tmx-parser/elements.rb', line 89 def length @length end |
#start ⇒ Object
Returns the value of attribute start.
89 90 91 |
# File 'lib/tmx-parser/elements.rb', line 89 def start @start end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
88 89 90 |
# File 'lib/tmx-parser/elements.rb', line 88 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
88 89 90 |
# File 'lib/tmx-parser/elements.rb', line 88 def type @type end |
Instance Method Details
#==(other_placeholder) ⇒ Object
107 108 109 110 111 112 |
# File 'lib/tmx-parser/elements.rb', line 107 def ==(other_placeholder) type == other_placeholder.type && text == other_placeholder.type && start == other_placeholder.start && length == other_placeholder.length end |
#copy ⇒ Object
100 101 102 103 104 105 |
# File 'lib/tmx-parser/elements.rb', line 100 def copy self.class.new(type.dup, text.dup).tap do |new_placeholder| new_placeholder.start = start # can't dup fixnums new_placeholder.length = length end end |
#receive_text(str) ⇒ Object
96 97 98 |
# File 'lib/tmx-parser/elements.rb', line 96 def receive_text(str) @text << str end |