Class: DataMetaDom::RecIdentity

Inherits:
RecAttrSet show all
Defined in:
lib/dataMetaDom/recAttr.rb

Overview

Record attrubute “identity

Instance Attribute Summary

Attributes inherited from RecAttrSet

#argSet

Attributes inherited from RecAttr

#args, #hints, #key, #keyword

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RecAttrSet

#addArg, #argSetTextual, #getKey, #hasArg?, #parse, #recAttrParse

Methods inherited from RecAttr

#[], #addArg, #addArgs, #addHint, #addHints, #hasHint?, #join, #length, #parse, #to_s, #updateKey

Constructor Details

#initializeRecIdentity

Creates an instance with the keyword “identity



230
231
232
233
# File 'lib/dataMetaDom/recAttr.rb', line 230

def initialize
    #noinspection RubyArgCount
    super(IDENTITY)
end

Class Method Details

.consumed?(source, record) ⇒ Boolean

Attempts to consume the “identity” attribute for the given Record from the given source.

  • Parameters

    • source - an instance of SourceFile

Returns:

  • (Boolean)


240
241
242
# File 'lib/dataMetaDom/recAttr.rb', line 240

def self.consumed?(source, record)
    source.line =~ /^#{IDENTITY}\W+.+$/ ? record.identity = RecIdentity.new.parse(source) : nil
end