Class: Manager::Spec

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSpec

Returns a new instance of Spec.



49
# File 'lib/manager.rb', line 49

def initialize; @hidden, @alts, @items = false, {}, [] end

Instance Attribute Details

#aliasesObject

Returns the value of attribute aliases.



48
49
50
# File 'lib/manager.rb', line 48

def aliases
  @aliases
end

#altsObject

Returns the value of attribute alts.



48
49
50
# File 'lib/manager.rb', line 48

def alts
  @alts
end

#documentationObject

Returns the value of attribute documentation.



48
49
50
# File 'lib/manager.rb', line 48

def documentation
  @documentation
end

#headerObject

Returns the value of attribute header.



48
49
50
# File 'lib/manager.rb', line 48

def header
  @header
end

#hiddenObject

Returns the value of attribute hidden.



48
49
50
# File 'lib/manager.rb', line 48

def hidden
  @hidden
end

#iObject (readonly)

Returns the value of attribute i.



47
48
49
# File 'lib/manager.rb', line 47

def i
  @i
end

#itemsObject (readonly)

Returns the value of attribute items.



47
48
49
# File 'lib/manager.rb', line 47

def items
  @items
end

#typeObject

Returns the value of attribute type.



48
49
50
# File 'lib/manager.rb', line 48

def type
  @type
end

Instance Method Details

#missing?(type, module_documentation, module_hidden) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/manager.rb', line 55

def missing? type, module_documentation, module_hidden
	#! Cannot replace `===` with `kind_of?` because `e` may be a `SanitizedObject`.
	@type = Render::Tag.new(module_hidden || @hidden, nil, type.to_s)
	if module_documentation.! and @undocumented
		@documentation = Render::Tag.new(true, "Undocumented")
	elsif module_hidden.! and @hidden.!
		if @items.none?{|e| Manager::UnitTest === e}
			@items.push(Render::BulletWrapper.new("Missing test", message: "Not unit tested."))
		end
		if @items.none?{|e| Render::UserParagraph === e}
			@items.push(Render::BulletWrapper
			.new("Missing Doc", message: "No paragraph given for user."))
		elsif @items.none?{|e| Render::MethodSignature === e}
		   case type; when :singleton, :instance
				@items.push(Render::BulletWrapper
				.new("Missing Doc", message: "No method signature given."))
			end
		end
	end
end

#order_fixObject



54
# File 'lib/manager.rb', line 54

def order_fix; @i = Manager.counts[:spec] += 1 end

#undocumented_markObject



50
51
52
53
# File 'lib/manager.rb', line 50

def undocumented_mark
	@undocumented = true
	self
end