Class: BitClust::RRDParser::Signature

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

Constant Summary

Constants included from NameUtils

NameUtils::CHAR_TO_MARK, NameUtils::CHAR_TO_NAME, NameUtils::CLASS_NAME_RE, NameUtils::CLASS_PATH_RE, NameUtils::CONST_PATH_RE, NameUtils::CONST_RE, NameUtils::GVAR_RE, NameUtils::LIBNAME_RE, NameUtils::MARK_TO_CHAR, NameUtils::MARK_TO_NAME, NameUtils::METHOD_NAME_RE, NameUtils::METHOD_SPEC_RE, NameUtils::MID, NameUtils::NAME_TO_CHAR, NameUtils::NAME_TO_MARK, NameUtils::TYPEMARK_RE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from NameUtils

build_method_id, classid2name, classname2id, classname?, decodeid, decodename_fs, decodename_url, encodeid, encodename_fs, encodename_rdocurl, encodename_url, functionname?, gvarname?, html_filename, libid2name, libname2id, libname?, method_spec?, methodid2classid, methodid2libid, methodid2mname, methodid2specparts, methodid2specstring, methodid2typechar, methodid2typemark, methodid2typename, methodname?, split_method_id, split_method_spec, typechar2mark, typechar2name, typechar?, typemark2char, typemark2name, typemark?, typename2char, typename2mark, typename?

Constructor Details

#initialize(c, t, m) ⇒ Signature

Returns a new instance of Signature.



505
506
507
508
509
# File 'lib/bitclust/rrdparser.rb', line 505

def initialize(c, t, m)
  @klass = c   # String
  @type = t
  @name = m
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



511
512
513
# File 'lib/bitclust/rrdparser.rb', line 511

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



513
514
515
# File 'lib/bitclust/rrdparser.rb', line 513

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



512
513
514
# File 'lib/bitclust/rrdparser.rb', line 512

def type
  @type
end

Instance Method Details

#compatible?(other) ⇒ Boolean

Returns:

  • (Boolean)


531
532
533
534
# File 'lib/bitclust/rrdparser.rb', line 531

def compatible?(other)
  (not @klass or not other.klass or @klass == other.klass) and
  (not @type  or not other.type  or @type  == other.type)
end

#fully_qualified?Boolean

Returns:

  • (Boolean)


536
537
538
# File 'lib/bitclust/rrdparser.rb', line 536

def fully_qualified?
  (@klass and @type) ? true : false
end

#inspectObject



515
516
517
# File 'lib/bitclust/rrdparser.rb', line 515

def inspect
  "\#<signature #{to_s()}>"
end

#same_type?(other) ⇒ Boolean

Returns:

  • (Boolean)


527
528
529
# File 'lib/bitclust/rrdparser.rb', line 527

def same_type?(other)
  @klass == other.klass and @type == other.type
end

#to_sObject



519
520
521
# File 'lib/bitclust/rrdparser.rb', line 519

def to_s
  "#{@klass || '_'}#{@type || ' _ '}#{@name}"
end

#typenameObject



523
524
525
# File 'lib/bitclust/rrdparser.rb', line 523

def typename
  typemark2name(@type)
end