Class: OpenFlow::Protocol::SuperclassBase

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/openflow-protocol/helpers/superclass_base.rb

Direct Known Subclasses

Action, Message, QueueProperty

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#type_strObject (readonly)

Returns the value of attribute type_str.



6
7
8
# File 'lib/openflow-protocol/helpers/superclass_base.rb', line 6

def type_str
  @type_str
end

Instance Method Details

#body_lengthObject



21
22
23
# File 'lib/openflow-protocol/helpers/superclass_base.rb', line 21

def body_length
  0
end

#initialize_instanceObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/openflow-protocol/helpers/superclass_base.rb', line 10

def initialize_instance
  super
  name = self.class.name.split('::').last
  if name[0..5] == 'Action'
    name = name[6..-1]
  elsif name[0..12] == 'QueueProperty'
    name = name[13..-1]
  end
  @type_str = name.gsub(/([A-Z])/, '_\1')[1..-1].downcase
end