Class: Bri::Match::Class

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

Constant Summary collapse

TEMPLATE =
Bri::Templates::CLASS_DESCRIPTION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Templates::Helpers

add_separators, array_to_width, hrule, section_header

Methods inherited from Base

#to_s

Constructor Details

#initialize(rdoc_result) ⇒ Class

Returns a new instance of Class.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/bri/match/class.rb', line 14

def initialize( rdoc_result )
  @type = rdoc_result.type
  @name = rdoc_result.name
  @description_paragraphs = build_description( rdoc_result.comment.parts )
  @includes = rdoc_result.includes.collect { |i| i.full_name }
  @constants = rdoc_result.constants.collect do |c|
                 c.value ? "#{c.name} = #{c.value}" : c.name
               end
  @attributes = rdoc_result.attributes.collect { |a| "#{a.name} (#{a.rw})" }

  class_methods, instance_methods = rdoc_result.method_list.
                                                select {|m| m.visibility == :public }.
                                                partition { |m| m.singleton }
  @class_methods = class_methods.collect { |m| m.name }
  @instance_methods = instance_methods.collect { |m| m.name }
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



12
13
14
# File 'lib/bri/match/class.rb', line 12

def attributes
  @attributes
end

#class_methodsObject (readonly)

Returns the value of attribute class_methods.



11
12
13
# File 'lib/bri/match/class.rb', line 11

def class_methods
  @class_methods
end

#constantsObject (readonly)

Returns the value of attribute constants.



11
12
13
# File 'lib/bri/match/class.rb', line 11

def constants
  @constants
end

#description_paragraphsObject (readonly)

Returns the value of attribute description_paragraphs.



10
11
12
# File 'lib/bri/match/class.rb', line 10

def description_paragraphs
  @description_paragraphs
end

#includesObject (readonly)

Returns the value of attribute includes.



11
12
13
# File 'lib/bri/match/class.rb', line 11

def includes
  @includes
end

#instance_methodsObject (readonly)

Returns the value of attribute instance_methods.



11
12
13
# File 'lib/bri/match/class.rb', line 11

def instance_methods
  @instance_methods
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/bri/match/class.rb', line 10

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



10
11
12
# File 'lib/bri/match/class.rb', line 10

def type
  @type
end