Class: WordnetJapanDiagram::CommandOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/wordnet_japan_diagram/command_options.rb

Instance Method Summary collapse

Constructor Details

#initialize(options:) ⇒ CommandOptions

Returns a new instance of CommandOptions.



5
6
7
# File 'lib/wordnet_japan_diagram/command_options.rb', line 5

def initialize(options:)
  @options = options
end

Instance Method Details

#diagram_creater_optionsObject



15
16
17
18
19
20
21
22
23
# File 'lib/wordnet_japan_diagram/command_options.rb', line 15

def diagram_creater_options
  {
    search_word: @options[:search_word],
    output_diagram_path: @options[:output_diagram_path],
    node_contents: @options[:node_contents],
    height_from_target: @options[:height_from_target].nil? ? nil : @options[:height_from_target].to_i,
    depth_from_target: @options[:depth_from_target].nil? ? nil : @options[:depth_from_target].to_i
  }
end

#graph_viz_optionsObject



25
26
27
28
29
# File 'lib/wordnet_japan_diagram/command_options.rb', line 25

def graph_viz_options
  {
    rankdir: @options[:graph_rankdir].to_sym
  }
end

#wordnet_japan_db_optionsObject



9
10
11
12
13
# File 'lib/wordnet_japan_diagram/command_options.rb', line 9

def wordnet_japan_db_options
  {
    database: @options[:wordnet_japan_db_file_path]
  }
end