Class: Xapor::Config
- Inherits:
-
Object
- Object
- Xapor::Config
- Defined in:
- lib/xapor/config.rb
Instance Attribute Summary collapse
-
#directory_config ⇒ Object
readonly
Returns the value of attribute directory_config.
-
#search_fields ⇒ Object
readonly
Returns the value of attribute search_fields.
-
#store_fields ⇒ Object
readonly
Returns the value of attribute store_fields.
Instance Method Summary collapse
- #directory(path) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #search(field, options = {}) ⇒ Object
- #xapian_fu_db ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
6 7 8 9 |
# File 'lib/xapor/config.rb', line 6 def initialize @search_fields = [] @store_fields = [] end |
Instance Attribute Details
#directory_config ⇒ Object (readonly)
Returns the value of attribute directory_config.
4 5 6 |
# File 'lib/xapor/config.rb', line 4 def directory_config @directory_config end |
#search_fields ⇒ Object (readonly)
Returns the value of attribute search_fields.
2 3 4 |
# File 'lib/xapor/config.rb', line 2 def search_fields @search_fields end |
#store_fields ⇒ Object (readonly)
Returns the value of attribute store_fields.
3 4 5 |
# File 'lib/xapor/config.rb', line 3 def store_fields @store_fields end |
Instance Method Details
#directory(path) ⇒ Object
18 19 20 |
# File 'lib/xapor/config.rb', line 18 def directory(path) @directory_config = path end |
#search(field, options = {}) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/xapor/config.rb', line 11 def search(field, = {}) @search_fields << field if [:store] @store_fields << field end end |
#xapian_fu_db ⇒ Object
22 23 24 25 26 27 |
# File 'lib/xapor/config.rb', line 22 def xapian_fu_db db_settings = {} db_settings[:dir] = @directory_config if @directory_config db_settings[:store] = @store_fields unless @store_fields.empty? return db_settings end |