Lines Matching full:option
27 class Option < SimpleDelegator class
31 raise "Compound option should not have `type` field, it is always bool" if respond_to?(:type)
32 …raise "Compound option should not have `default` field, it is always `false``" if respond_to?(:def…
169 def create_sub_options(option, options) argument
170 return unless option.has_sub_options
171 raise "Only boolean option can have sub options: #{option.name}" unless option.type == 'bool'
173 option.sub_options.each_with_object(sub_options) do |sub_option, sub_options|
174 sub_option[:parent] = option
175 sub_options << Option.new(sub_option)
178 option[:sub_options] = sub_options
182 @options ||= @data.options.each_with_object([]) do |option, options|
183 option_hash = option.to_h
188 option.lang.each do |lang|
189 lang_spec_option[:description] = "#{option.description}. Only for #{lang}"
190 lang_spec_option[:name] = "#{lang}.#{option.name}"
191 options << Option.new(OpenStruct.new(lang_spec_option))
195 main_option[:name] = "#{option.name}"
196 options << Option.new(OpenStruct.new(main_option))
199 options << Option.new(option)