Class: AMF::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/amf/header.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, required, data) ⇒ Header

Returns a new instance of Header.



5
6
7
8
9
# File 'lib/amf/header.rb', line 5

def initialize( target, required, data )
  @target = target
  @required = required
  @data = data
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/amf/header.rb', line 3

def data
  @data
end

#requiredObject

Returns the value of attribute required.



3
4
5
# File 'lib/amf/header.rb', line 3

def required
  @required
end

#targetObject

Returns the value of attribute target.



3
4
5
# File 'lib/amf/header.rb', line 3

def target
  @target
end

Instance Method Details

#eachObject

needed this method, it is a bit of a hack



16
17
18
# File 'lib/amf/header.rb', line 16

def each
  self.to_hash.each
end

#to_hashObject



11
12
13
# File 'lib/amf/header.rb', line 11

def to_hash
  { 'name' => self.target, 'required' => self.required, 'data' => self.data }
end