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.



643
644
645
646
647
# File 'lib/bitclust/rrdparser.rb', line 643

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

Instance Attribute Details

#namesObject (readonly)

Returns the value of attribute names.



650
651
652
# File 'lib/bitclust/rrdparser.rb', line 650

def names
  @names
end

#signatureObject (readonly)

Returns the value of attribute signature.



649
650
651
# File 'lib/bitclust/rrdparser.rb', line 649

def signature
  @signature
end

#sourceObject (readonly)

Returns the value of attribute source.



651
652
653
# File 'lib/bitclust/rrdparser.rb', line 651

def source
  @source
end

Instance Method Details

#alias?(other) ⇒ Boolean

Returns:

  • (Boolean)


657
658
659
660
# File 'lib/bitclust/rrdparser.rb', line 657

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

#inspectObject



653
654
655
# File 'lib/bitclust/rrdparser.rb', line 653

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

#unify(other) ⇒ Object



662
663
664
665
# File 'lib/bitclust/rrdparser.rb', line 662

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