Class: Docurium::Warning
- Inherits:
-
Object
- Object
- Docurium::Warning
- Defined in:
- lib/docurium.rb
Direct Known Subclasses
Defined Under Namespace
Classes: MissingDocumentation, SignatureChanged, UnmatchedParameter
Constant Summary collapse
- WARNINGS =
[ :unmatched_param, :signature_changed, :missing_documentation, ]
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#warning ⇒ Object
readonly
Returns the value of attribute warning.
Instance Method Summary collapse
-
#initialize(warning, type, identifier, opts = {}) ⇒ Warning
constructor
A new instance of Warning.
- #message ⇒ Object
Constructor Details
#initialize(warning, type, identifier, opts = {}) ⇒ Warning
Returns a new instance of Warning.
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/docurium.rb', line 278 def initialize(warning, type, identifier, opts = {}) raise ArgumentError.new("invalid warning class") unless WARNINGS.include?(warning) @warning = warning @type = type @identifier = identifier if type = opts.delete(:type) @file = type[:file] if input_dir = opts.delete(:input_dir) File.(File.join(input_dir, @file)) end @file ||= "<missing>" @line = type[:line] || 1 @column = type[:column] || 1 end end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
276 277 278 |
# File 'lib/docurium.rb', line 276 def column @column end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
276 277 278 |
# File 'lib/docurium.rb', line 276 def file @file end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
276 277 278 |
# File 'lib/docurium.rb', line 276 def identifier @identifier end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
276 277 278 |
# File 'lib/docurium.rb', line 276 def line @line end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
276 277 278 |
# File 'lib/docurium.rb', line 276 def type @type end |
#warning ⇒ Object (readonly)
Returns the value of attribute warning.
276 277 278 |
# File 'lib/docurium.rb', line 276 def warning @warning end |
Instance Method Details
#message ⇒ Object
294 295 296 297 |
# File 'lib/docurium.rb', line 294 def msg = self. msg.kind_of?(Array) ? msg.shift % msg.map {|a| self.send(a).to_s } : msg end |