Class: MarkdownRubyDocumentation::Generate::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/markdown_ruby_documentation/generate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subject_class:, subject_location:, methods: [], load_path:, output_object:, erb_methods_class:) ⇒ Page

Returns a new instance of Page.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/markdown_ruby_documentation/generate.rb', line 68

def initialize(subject_class:,
               subject_location:,
               methods: [],
               load_path:,
               output_object:,
               erb_methods_class:)
  initialize_methods(methods, subject_class, subject_location)
  @erb_methods_class = erb_methods_class
  @subject           = subject_class
  @subject_location  = subject_location
  methods            = methods
  @methods           = methods
  @load_path         = load_path
  @output_object     = output_object
end

Instance Attribute Details

#erb_methods_classObject (readonly)

Returns the value of attribute erb_methods_class.



66
67
68
# File 'lib/markdown_ruby_documentation/generate.rb', line 66

def erb_methods_class
  @erb_methods_class
end

#load_pathObject (readonly)

Returns the value of attribute load_path.



66
67
68
# File 'lib/markdown_ruby_documentation/generate.rb', line 66

def load_path
  @load_path
end

#output_objectObject (readonly)

Returns the value of attribute output_object.



66
67
68
# File 'lib/markdown_ruby_documentation/generate.rb', line 66

def output_object
  @output_object
end

#subjectObject (readonly)

Returns the value of attribute subject.



66
67
68
# File 'lib/markdown_ruby_documentation/generate.rb', line 66

def subject
  @subject
end

#subject_locationObject (readonly)

Returns the value of attribute subject_location.



66
67
68
# File 'lib/markdown_ruby_documentation/generate.rb', line 66

def subject_location
  @subject_location
end

Instance Method Details

#callObject



84
85
86
87
88
89
90
# File 'lib/markdown_ruby_documentation/generate.rb', line 84

def call
  methods_pipes = run_pipeline(methods_pipeline)
  text          = run_pipeline(string_pipeline, methods_pipes)
  output_object.call(name: subject.name,
                     text: text)
  self
end