Class: XLIFFer::XLIFF::String
- Inherits:
-
Object
- Object
- XLIFFer::XLIFF::String
- Defined in:
- lib/xliffer/xliff/string.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#note ⇒ Object
readonly
Returns the value of attribute note.
-
#source ⇒ Object
Returns the value of attribute source.
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(trans_unit_xml) ⇒ String
constructor
A new instance of String.
Constructor Details
#initialize(trans_unit_xml) ⇒ String
Returns a new instance of String.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/xliffer/xliff/string.rb', line 5 def initialize(trans_unit_xml) unless XLIFF::xml_element?(trans_unit_xml) and trans_unit?(trans_unit_xml) raise ArgumentError, "can't create a String without a trans-unit subtree" end @xml = trans_unit_xml @id = @xml.attr('id') @source = get_source @target = get_target @note = get_note end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/xliffer/xliff/string.rb', line 4 def id @id end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
4 5 6 |
# File 'lib/xliffer/xliff/string.rb', line 4 def note @note end |
#source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/xliffer/xliff/string.rb', line 4 def source @source end |
#target ⇒ Object
Returns the value of attribute target.
4 5 6 |
# File 'lib/xliffer/xliff/string.rb', line 4 def target @target end |