Class: Mkmatter::Questions::Page

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/mkmatter/questions.rb

Instance Attribute Summary collapse

Attributes included from Common

#time_zone

Instance Method Summary collapse

Methods included from Common

#get_001_title, #get_002_tags, #get_003_categories, #get_004_time_zone, #get_005_file_format

Instance Attribute Details

#answersObject (readonly)

Returns the value of attribute answers.



35
36
37
# File 'lib/mkmatter/questions.rb', line 35

def answers
  @answers
end

#highline_contextObject (readonly)

Returns the value of attribute highline_context.



36
37
38
# File 'lib/mkmatter/questions.rb', line 36

def highline_context
  @highline_context
end

Instance Method Details

#askOpenStruct

Returns:

  • (OpenStruct)


47
48
49
50
51
52
53
54
# File 'lib/mkmatter/questions.rb', line 47

def ask
  known_questions = self.methods.sort.delete_if { |m| m.to_s !~ /^get_.*$/ }
  known_questions.each do |m|
    @answers[:layout] = 'page'
    @answers[m.to_s.gsub(/^get_[0-9]{3}_/, '')] = self.method(m).call(@highline_context)
  end
  @answers
end