Class: Racket::RacketPart

Inherits:
BitStruct
  • Object
show all
Defined in:
lib/racket/racketpart.rb

Overview

Every Racket object is made up of numerous sub-parts, namely layers of the OSI stack.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ RacketPart

Returns a new instance of RacketPart.



45
46
47
48
# File 'lib/racket/racketpart.rb', line 45

def initialize(*args)
  @autofix = true
  super(*args)
end

Instance Attribute Details

#autofixObject

Boolean indicating whether or not this instance should be automatically “fixed” prior to be packed and sent.



37
38
39
# File 'lib/racket/racketpart.rb', line 37

def autofix
  @autofix
end

Instance Method Details

#autofix?Boolean

Should this instance be automatically fixed prior to being packed and sent?

Returns:

  • (Boolean)


41
42
43
# File 'lib/racket/racketpart.rb', line 41

def autofix?
  @autofix
end

#fix!Object



62
63
# File 'lib/racket/racketpart.rb', line 62

def fix!
end

#prettyObject

Print out all of the fields and all of their values



52
53
54
55
56
57
58
59
60
# File 'lib/racket/racketpart.rb', line 52

def pretty
  s  = ""
  self.fields.each do |f|
    unless (f.name == "payload")
      s += "#{f.name}=#{self.send(f.name)} "
    end
  end
  s.gsub(/ $/, '')
end