Class: BitClust::RRDParser::Chunk

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(signature, names, source) ⇒ Chunk

Returns a new instance of Chunk.



477
478
479
480
481
# File 'lib/bitclust/rrdparser.rb', line 477

def initialize(signature, names, source)
  @signature = signature
  @names = names
  @source = source
end

Instance Attribute Details

#namesObject (readonly)

Returns the value of attribute names.



484
485
486
# File 'lib/bitclust/rrdparser.rb', line 484

def names
  @names
end

#signatureObject (readonly)

Returns the value of attribute signature.



483
484
485
# File 'lib/bitclust/rrdparser.rb', line 483

def signature
  @signature
end

#sourceObject (readonly)

Returns the value of attribute source.



485
486
487
# File 'lib/bitclust/rrdparser.rb', line 485

def source
  @source
end

Instance Method Details

#alias?(other) ⇒ Boolean

Returns:

  • (Boolean)


491
492
493
494
# File 'lib/bitclust/rrdparser.rb', line 491

def alias?(other)
  @signature.compatible?(other.signature) and
      not (@names & other.names).empty?
end

#inspectObject



487
488
489
# File 'lib/bitclust/rrdparser.rb', line 487

def inspect
  "\#<Chunk #{@signature.klass}#{@signature.type}#{@names.join(',')} #{@source.location}>"
end

#unify(other) ⇒ Object



496
497
498
499
# File 'lib/bitclust/rrdparser.rb', line 496

def unify(other)
  @names |= other.names
  @source << other.source
end