Class: Mkmatter::Questions::Post

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.



10
11
12
# File 'lib/mkmatter/questions.rb', line 10

def answers
  @answers
end

#highline_contextObject (readonly)

Returns the value of attribute highline_context.



11
12
13
# File 'lib/mkmatter/questions.rb', line 11

def highline_context
  @highline_context
end

Instance Method Details

#askOpenStruct

Returns:

  • (OpenStruct)


23
24
25
26
27
28
29
30
# File 'lib/mkmatter/questions.rb', line 23

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