Class: Locca::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/locca/projects/project.rb

Direct Known Subclasses

AndroidProject, XcodeProject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir, config) ⇒ Project

Returns a new instance of Project.



30
31
32
33
34
35
# File 'lib/locca/projects/project.rb', line 30

def initialize(dir, config)
    @dir = dir
    @config = config
                
    @base_lang = config['base_lang']
end

Instance Attribute Details

#base_langObject (readonly)

Returns the value of attribute base_lang.



28
29
30
# File 'lib/locca/projects/project.rb', line 28

def base_lang
  @base_lang
end

#dirObject (readonly)

Returns the value of attribute dir.



27
28
29
# File 'lib/locca/projects/project.rb', line 27

def dir
  @dir
end

Instance Method Details

#collection_builderObject



67
68
69
# File 'lib/locca/projects/project.rb', line 67

def collection_builder
    # implement in subclass
end

#collection_namesObject



55
56
57
# File 'lib/locca/projects/project.rb', line 55

def collection_names
    # implement in subclass 
end

#collection_writerObject



71
72
73
# File 'lib/locca/projects/project.rb', line 71

def collection_writer
    # implement in subclass
end

#collections_generatorObject



75
76
77
# File 'lib/locca/projects/project.rb', line 75

def collections_generator
    # implement in subclass
end

#config_value_for_key(key) ⇒ Object



37
38
39
# File 'lib/locca/projects/project.rb', line 37

def config_value_for_key(key)
    return @config[key]
end

#full_collection_name(collection_name) ⇒ Object



59
60
61
# File 'lib/locca/projects/project.rb', line 59

def full_collection_name(collection_name)
   # implement in subclass
end

#langsObject



51
52
53
# File 'lib/locca/projects/project.rb', line 51

def langs
    # implement in subclass
end

#nameObject



83
84
85
# File 'lib/locca/projects/project.rb', line 83

def name
    return ""
end

#one_sky_file_formatObject



79
80
81
# File 'lib/locca/projects/project.rb', line 79

def one_sky_file_format
    # implement in subclass
end

#path_for_collection(collection_name, lang) ⇒ Object



63
64
65
# File 'lib/locca/projects/project.rb', line 63

def path_for_collection(collection_name, lang)
    # implement in subclass
end

#prevent_sync_without_comments?Boolean

Returns:

  • (Boolean)


41
42
43
44
45
46
47
48
49
# File 'lib/locca/projects/project.rb', line 41

def prevent_sync_without_comments?
    value = @config['prevent_sync_without_comments']
    if value == true ||
        value == 1
        return true
    else
        return false
    end
end