Class: XLIFFer::XLIFF

Inherits:
Object
  • Object
show all
Defined in:
lib/xliffer/xliff.rb,
lib/xliffer/xliff/file.rb,
lib/xliffer/xliff/string.rb

Defined Under Namespace

Classes: File, String

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filesObject (readonly)

Returns the value of attribute files.



6
7
8
# File 'lib/xliffer/xliff.rb', line 6

def files
  @files
end

#versionObject (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_sObject



17
18
19
# File 'lib/xliffer/xliff.rb', line 17

def to_s
  @xml.to_xml
end