Class: Bri::Match::Class
- Includes:
- Templates::Helpers
- Defined in:
- lib/bri/match/class.rb
Constant Summary collapse
- TEMPLATE =
Bri::Templates::CLASS_DESCRIPTION
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#class_methods ⇒ Object
readonly
Returns the value of attribute class_methods.
-
#constants ⇒ Object
readonly
Returns the value of attribute constants.
-
#description_paragraphs ⇒ Object
readonly
Returns the value of attribute description_paragraphs.
-
#includes ⇒ Object
readonly
Returns the value of attribute includes.
-
#instance_methods ⇒ Object
readonly
Returns the value of attribute instance_methods.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(rdoc_result) ⇒ Class
constructor
A new instance of Class.
Methods included from Templates::Helpers
add_separators, array_to_width, hrule, section_header
Methods inherited from Base
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
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
12 13 14 |
# File 'lib/bri/match/class.rb', line 12 def attributes @attributes end |
#class_methods ⇒ Object (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 |
#constants ⇒ Object (readonly)
Returns the value of attribute constants.
11 12 13 |
# File 'lib/bri/match/class.rb', line 11 def constants @constants end |
#description_paragraphs ⇒ Object (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 |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
11 12 13 |
# File 'lib/bri/match/class.rb', line 11 def includes @includes end |
#instance_methods ⇒ Object (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 |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/bri/match/class.rb', line 10 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/bri/match/class.rb', line 10 def type @type end |