Class: Appydave::Tools::BrainContextOptions
- Inherits:
-
Object
- Object
- Appydave::Tools::BrainContextOptions
- Defined in:
- lib/appydave/tools/brain_context/options.rb
Overview
Options struct for brain/OMI query tools
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#base_dir ⇒ Object
Returns the value of attribute base_dir.
-
#brain_names ⇒ Object
Returns the value of attribute brain_names.
-
#categories ⇒ Object
Returns the value of attribute categories.
-
#date_from ⇒ Object
Returns the value of attribute date_from.
-
#date_to ⇒ Object
Returns the value of attribute date_to.
-
#days ⇒ Object
Returns the value of attribute days.
-
#debug_level ⇒ Object
Returns the value of attribute debug_level.
-
#dry_run ⇒ Object
Returns the value of attribute dry_run.
-
#enriched_only ⇒ Object
Returns the value of attribute enriched_only.
-
#formats ⇒ Object
Returns the value of attribute formats.
-
#include_index ⇒ Object
Returns the value of attribute include_index.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#line_limit ⇒ Object
Returns the value of attribute line_limit.
-
#meta ⇒ Object
Returns the value of attribute meta.
-
#omi ⇒ Object
Returns the value of attribute omi.
-
#omi_activities ⇒ Object
Returns the value of attribute omi_activities.
-
#omi_dir ⇒ Object
Returns the value of attribute omi_dir.
-
#omi_routings ⇒ Object
Returns the value of attribute omi_routings.
-
#output_targets ⇒ Object
Returns the value of attribute output_targets.
-
#tokens ⇒ Object
Returns the value of attribute tokens.
Instance Method Summary collapse
- #brain_query? ⇒ Boolean
- #brains_index_path ⇒ Object
- #brains_root ⇒ Object
-
#initialize ⇒ BrainContextOptions
constructor
A new instance of BrainContextOptions.
- #omi_query? ⇒ Boolean
Constructor Details
#initialize ⇒ BrainContextOptions
Returns a new instance of BrainContextOptions.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/appydave/tools/brain_context/options.rb', line 13 def initialize @brain_names = [] @categories = [] @active = false @meta = false @omi = false @omi_routings = [] @omi_activities = [] @date_from = nil @date_to = nil @enriched_only = true @days = nil @limit = nil @include_index = true @output_targets = ['clipboard'] # default to clipboard @formats = ['content'] @line_limit = nil @debug_level = 'none' @dry_run = false @tokens = false @base_dir = Dir.pwd configured_omi = read_setting('omi-directory-path') @omi_dir = configured_omi || File.('~/dev/raw-intake/omi') end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def active @active end |
#base_dir ⇒ Object
Returns the value of attribute base_dir.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def base_dir @base_dir end |
#brain_names ⇒ Object
Returns the value of attribute brain_names.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def brain_names @brain_names end |
#categories ⇒ Object
Returns the value of attribute categories.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def categories @categories end |
#date_from ⇒ Object
Returns the value of attribute date_from.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def date_from @date_from end |
#date_to ⇒ Object
Returns the value of attribute date_to.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def date_to @date_to end |
#days ⇒ Object
Returns the value of attribute days.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def days @days end |
#debug_level ⇒ Object
Returns the value of attribute debug_level.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def debug_level @debug_level end |
#dry_run ⇒ Object
Returns the value of attribute dry_run.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def dry_run @dry_run end |
#enriched_only ⇒ Object
Returns the value of attribute enriched_only.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def enriched_only @enriched_only end |
#formats ⇒ Object
Returns the value of attribute formats.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def formats @formats end |
#include_index ⇒ Object
Returns the value of attribute include_index.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def include_index @include_index end |
#limit ⇒ Object
Returns the value of attribute limit.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def limit @limit end |
#line_limit ⇒ Object
Returns the value of attribute line_limit.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def line_limit @line_limit end |
#meta ⇒ Object
Returns the value of attribute meta.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def @meta end |
#omi ⇒ Object
Returns the value of attribute omi.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def omi @omi end |
#omi_activities ⇒ Object
Returns the value of attribute omi_activities.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def omi_activities @omi_activities end |
#omi_dir ⇒ Object
Returns the value of attribute omi_dir.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def omi_dir @omi_dir end |
#omi_routings ⇒ Object
Returns the value of attribute omi_routings.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def omi_routings @omi_routings end |
#output_targets ⇒ Object
Returns the value of attribute output_targets.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def output_targets @output_targets end |
#tokens ⇒ Object
Returns the value of attribute tokens.
7 8 9 |
# File 'lib/appydave/tools/brain_context/options.rb', line 7 def tokens @tokens end |
Instance Method Details
#brain_query? ⇒ Boolean
52 53 54 |
# File 'lib/appydave/tools/brain_context/options.rb', line 52 def brain_query? brain_names.any? || categories.any? || active end |
#brains_index_path ⇒ Object
48 49 50 |
# File 'lib/appydave/tools/brain_context/options.rb', line 48 def brains_index_path File.join(brains_root, 'audit', 'brains-index.json') end |
#brains_root ⇒ Object
41 42 43 44 45 46 |
# File 'lib/appydave/tools/brain_context/options.rb', line 41 def brains_root @brains_root ||= begin configured = read_setting('brains-root-path') configured || File.('~/dev/ad/brains') end end |
#omi_query? ⇒ Boolean
56 57 58 |
# File 'lib/appydave/tools/brain_context/options.rb', line 56 def omi_query? omi end |