Class: DataMetaDom::VerDoccable

Inherits:
Documentable show all
Defined in:
lib/dataMetaDom/ver.rb

Overview

Anything having a version. It must be also documentable, but not everything documentable is also versionable, like, for example, Record Field or an Enum part.

Direct Known Subclasses

Enum, Field, Mapping, Record, SourceFile

Instance Attribute Summary collapse

Attributes inherited from Documentable

#docs

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Documentable

#addDoc, #all, #clear, #docConsumed?, #getDoc, #has?, #ids, #initialize

Constructor Details

This class inherits a constructor from DataMetaDom::Documentable

Instance Attribute Details

#verObject

The version info, an instance of Ver.



225
226
227
# File 'lib/dataMetaDom/ver.rb', line 225

def ver
  @ver
end

Class Method Details

.verConsumed?(src) ⇒ Boolean

Attempts to parse an instance of Ver from the current line on the given instance of SourceFile. Returns the instance of Ver if successful, nil otherwise. Parameter:

  • src - the instance of SourceFile to parse the version info from.

Returns:

  • (Boolean)


239
240
241
# File 'lib/dataMetaDom/ver.rb', line 239

def self.verConsumed?(src)
    src.line =~ /^\s*#{VER_KW}\s+(\S+)\s*$/ ? Ver.new($1) : nil
end

Instance Method Details

#resetEntityObject

Resets stateful information on the entity level, like docs that should not apply to the next entity if missing.



229
230
231
# File 'lib/dataMetaDom/ver.rb', line 229

def resetEntity
    docs.clear
end