Class: DataMetaDom::RecIndex

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

Overview

Record attrubute “index

Instance Attribute Summary

Attributes inherited from RecAttr

#args, #hints, #key, #keyword

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RecAttrList

#getKey, #parse, #recAttrParse

Methods inherited from RecAttr

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

Constructor Details

#initializeRecIndex

Creates an instance with the keyword “index



251
252
253
254
# File 'lib/dataMetaDom/recAttr.rb', line 251

def initialize
#noinspection RubyArgCount
    super(INDEX)
end

Class Method Details

.consumed?(source, record) ⇒ Boolean

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

  • Parameters

    • source - an instance of SourceFile

Returns:

  • (Boolean)


261
262
263
# File 'lib/dataMetaDom/recAttr.rb', line 261

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