Class: Locfile

Inherits:
Object
  • Object
show all
Defined in:
lib/localio/locfile.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLocfile

Returns a new instance of Locfile.



31
32
33
34
35
36
37
38
39
# File 'lib/localio/locfile.rb', line 31

def initialize
  @platform_name = nil
  @platform_options = nil
  @source_service = :google_drive
  @source_path = nil
  @source_options = nil
  @output_path = './out/'
  @formatting = :smart
end

Class Method Details

.load(filename) ⇒ Object



59
60
61
62
63
# File 'lib/localio/locfile.rb', line 59

def self.load(filename)
  dsl = new
  dsl.instance_eval(File.read(filename), filename)
  dsl
end

Instance Method Details

#platform(name, options = {}) ⇒ Object

Defines the platform

service : any of the supported ones (see above) options : hash with extra options, view documentation for the different services



45
46
47
48
# File 'lib/localio/locfile.rb', line 45

def platform(name, options = {})
  @platform_name = name
  @platform_options = options
end

#source(service, options = {}) ⇒ Object

Defines the service storing the translations

service : can be :google_drive, :xls options : hash with extra options, view documentation for the different services



54
55
56
57
# File 'lib/localio/locfile.rb', line 54

def source(service, options = {})
  @source_service = service
  @source_options = options
end