Class: Spout::Models::Dictionary
- Inherits:
-
Object
- Object
- Spout::Models::Dictionary
- Defined in:
- lib/spout/models/dictionary.rb
Overview
Creates a structure that contains a dictionaries variables, domains, and forms
Instance Attribute Summary collapse
-
#app_path ⇒ Object
Returns the value of attribute app_path.
-
#domain_files ⇒ Object
readonly
Returns the value of attribute domain_files.
-
#domains ⇒ Object
Returns the value of attribute domains.
-
#form_files ⇒ Object
readonly
Returns the value of attribute form_files.
-
#forms ⇒ Object
Returns the value of attribute forms.
-
#variable_files ⇒ Object
readonly
Returns the value of attribute variable_files.
-
#variables ⇒ Object
Returns the value of attribute variables.
Instance Method Summary collapse
-
#initialize(app_path) ⇒ Dictionary
constructor
A new instance of Dictionary.
- #load_all! ⇒ Object
- #load_domains! ⇒ Object
- #load_forms! ⇒ Object
- #load_variables! ⇒ Object
Constructor Details
#initialize(app_path) ⇒ Dictionary
Returns a new instance of Dictionary.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/spout/models/dictionary.rb', line 17 def initialize(app_path) @app_path = app_path @variable_files = json_files("variables") @domain_files = json_files("domains") @form_files = json_files("forms") @variables = [] @domains = [] @forms = [] end |
Instance Attribute Details
#app_path ⇒ Object
Returns the value of attribute app_path.
13 14 15 |
# File 'lib/spout/models/dictionary.rb', line 13 def app_path @app_path end |
#domain_files ⇒ Object (readonly)
Returns the value of attribute domain_files.
15 16 17 |
# File 'lib/spout/models/dictionary.rb', line 15 def domain_files @domain_files end |
#domains ⇒ Object
Returns the value of attribute domains.
12 13 14 |
# File 'lib/spout/models/dictionary.rb', line 12 def domains @domains end |
#form_files ⇒ Object (readonly)
Returns the value of attribute form_files.
15 16 17 |
# File 'lib/spout/models/dictionary.rb', line 15 def form_files @form_files end |
#forms ⇒ Object
Returns the value of attribute forms.
12 13 14 |
# File 'lib/spout/models/dictionary.rb', line 12 def forms @forms end |
#variable_files ⇒ Object (readonly)
Returns the value of attribute variable_files.
15 16 17 |
# File 'lib/spout/models/dictionary.rb', line 15 def variable_files @variable_files end |
#variables ⇒ Object
Returns the value of attribute variables.
12 13 14 |
# File 'lib/spout/models/dictionary.rb', line 12 def variables @variables end |
Instance Method Details
#load_all! ⇒ Object
29 30 31 32 33 34 |
# File 'lib/spout/models/dictionary.rb', line 29 def load_all! load_variables! load_domains! load_forms! self end |
#load_domains! ⇒ Object
40 41 42 |
# File 'lib/spout/models/dictionary.rb', line 40 def load_domains! load_type!("Domain") end |
#load_forms! ⇒ Object
44 45 46 |
# File 'lib/spout/models/dictionary.rb', line 44 def load_forms! load_type!("Form") end |
#load_variables! ⇒ Object
36 37 38 |
# File 'lib/spout/models/dictionary.rb', line 36 def load_variables! load_type!("Variable") end |