Class: XLIFFer::XLIFF
- Inherits:
-
Object
- Object
- XLIFFer::XLIFF
- Defined in:
- lib/xliffer/xliff.rb,
lib/xliffer/xliff/file.rb,
lib/xliffer/xliff/string.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(xliff = nil) ⇒ XLIFF
constructor
A new instance of XLIFF.
- #to_s ⇒ Object
Constructor Details
#initialize(xliff = nil) ⇒ XLIFF
Returns a new instance of XLIFF.
7 8 9 10 11 12 13 14 15 |
# File 'lib/xliffer/xliff.rb', line 7 def initialize(xliff = nil) text = case xliff when ::IO then xliff.read when ::String then xliff else fail ArgumentError, "Expects an IO or String" end parse(text) end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
6 7 8 |
# File 'lib/xliffer/xliff.rb', line 6 def files @files end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
6 7 8 |
# File 'lib/xliffer/xliff.rb', line 6 def version @version end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/xliffer/xliff.rb', line 17 def to_s @xml.to_xml end |