Class: Gatherable::Configuration
- Inherits:
-
Object
- Object
- Gatherable::Configuration
- Defined in:
- lib/gatherable/configuration.rb
Instance Attribute Summary collapse
- #auth_method ⇒ Object
-
#global_identifier ⇒ Object
Returns the value of attribute global_identifier.
- #schema_name ⇒ Object
Instance Method Summary collapse
- #data_point(name, data_type, options = {}) ⇒ Object
- #data_table(name, columns, options = {}) ⇒ Object
- #data_tables ⇒ Object
- #prefixed_resources ⇒ Object
- #prefixed_resources=(resources) ⇒ Object
Instance Attribute Details
#auth_method ⇒ Object
23 24 25 |
# File 'lib/gatherable/configuration.rb', line 23 def auth_method @auth_method || :session end |
#global_identifier ⇒ Object
Returns the value of attribute global_identifier.
4 5 6 |
# File 'lib/gatherable/configuration.rb', line 4 def global_identifier @global_identifier end |
#schema_name ⇒ Object
19 20 21 |
# File 'lib/gatherable/configuration.rb', line 19 def schema_name @schema_name || 'gatherable' end |
Instance Method Details
#data_point(name, data_type, options = {}) ⇒ Object
7 8 9 |
# File 'lib/gatherable/configuration.rb', line 7 def data_point(name, data_type, = {}) data_tables << DataTable.new(name, {name => data_type}, ) end |
#data_table(name, columns, options = {}) ⇒ Object
11 12 13 |
# File 'lib/gatherable/configuration.rb', line 11 def data_table(name, columns, = {}) data_tables << DataTable.new(name, columns, ) end |
#data_tables ⇒ Object
15 16 17 |
# File 'lib/gatherable/configuration.rb', line 15 def data_tables @data_tables ||= [] end |
#prefixed_resources ⇒ Object
27 28 29 |
# File 'lib/gatherable/configuration.rb', line 27 def prefixed_resources @prefixed_resources ||= [] end |
#prefixed_resources=(resources) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/gatherable/configuration.rb', line 31 def prefixed_resources=(resources) all_table_names = DataTable.all.keys @prefixed_resources = case resources when String, Symbol, Array Array(resources).map(&:to_sym) && all_table_names when Hash if resources.key?(:only) Array(resources[:only]).map(&:to_sym) && all_table_names elsif resources.key?(:except) all_table_names - Array(resources[:except]).map(&:to_sym) end end end |