Class: Bri::Match::Method

Inherits:
Base
  • Object
show all
Includes:
Templates::Helpers
Defined in:
lib/bri/match/method.rb

Constant Summary collapse

TEMPLATE =
Bri::Templates::METHOD_DESCRIPTION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Templates::Helpers

hrule, #print_origin, section_header

Methods inherited from Base

#to_s

Constructor Details

#initialize(rdoc_method, store = nil) ⇒ Method

Returns a new instance of Method.



9
10
11
12
13
14
15
16
17
# File 'lib/bri/match/method.rb', line 9

def initialize( rdoc_method, store = nil )
  @full_name = rdoc_method.full_name
  @call_syntaxes = rdoc_method.arglists.lines( chomp: true ).
                                        map { |e| e.prepend( "  " ) }.
                                        join( "\n" ) + "\n" rescue ''

  @description_paragraphs = build_description_from_comment( rdoc_method.comment )
  @origin = store&.friendly_path
end

Instance Attribute Details

#call_syntaxesObject

Returns the value of attribute call_syntaxes.



7
8
9
# File 'lib/bri/match/method.rb', line 7

def call_syntaxes
  @call_syntaxes
end

#description_paragraphsObject

Returns the value of attribute description_paragraphs.



7
8
9
# File 'lib/bri/match/method.rb', line 7

def description_paragraphs
  @description_paragraphs
end

#full_nameObject

Returns the value of attribute full_name.



7
8
9
# File 'lib/bri/match/method.rb', line 7

def full_name
  @full_name
end

#originObject

Returns the value of attribute origin.



7
8
9
# File 'lib/bri/match/method.rb', line 7

def origin
  @origin
end