Class: C11n::Importer::Ios

Inherits:
Object
  • Object
show all
Defined in:
lib/c11n/importer/ios.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Ios

Returns a new instance of Ios.



6
7
8
9
10
11
# File 'lib/c11n/importer/ios.rb', line 6

def initialize(options = {})
  @path = options[:path]
  @locale = options[:locale]
  @types = {}
  @categories = {}
end

Instance Attribute Details

#categoriesObject (readonly)

Returns the value of attribute categories.



4
5
6
# File 'lib/c11n/importer/ios.rb', line 4

def categories
  @categories
end

#typesObject (readonly)

Returns the value of attribute types.



4
5
6
# File 'lib/c11n/importer/ios.rb', line 4

def types
  @types
end

Instance Method Details

#fileObject



23
24
25
# File 'lib/c11n/importer/ios.rb', line 23

def file
  File.open(@path, 'r')
end

#importObject



13
14
15
16
17
18
19
20
21
# File 'lib/c11n/importer/ios.rb', line 13

def import
  result = {}

  file.each_line do |line|
    result.merge parse(line)
  end

  result
end