class Object
When requiring ‘highline/import’ HighLine
adds {#or_ask} to Object
so
it is globally available.
Public Instance Methods
or_ask(*args) { |question| ... }
click to toggle source
Tries this object as a first_answer for a HighLine::Question
. See that attribute for details.
Warning: This Object
will be passed to String() before set.
@param args [Array<#to_s>] @param details [lambda] block to be called with the question
instance as argument.
@return [String] answer
# File lib/highline/import.rb, line 41 def or_ask(*args, &details) ask(*args) do |question| question.first_answer = String(self) yield(question) if details end end