Class: Person

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Person

Returns a new instance of Person.



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/person.rb', line 4

def initialize(data)
  length = BinData::Uint16le.read(data)
  LOGGER.debug "person length is #{length}"
  @name = BinData::String.new(:length => length).read(data)
  LOGGER.debug "person name is #{@name}"
  length = BinData::Uint16le.read(data)
  LOGGER.debug "club length is #{length}"
  @club = BinData::String.new(:length => length).read(data)

  @id = BinData::Uint32be.read(data)
  LOGGER.debug "id is #{@id}"
end

Instance Attribute Details

#clubObject (readonly)

Returns the value of attribute club.



2
3
4
# File 'lib/person.rb', line 2

def club
  @club
end

#idObject (readonly)

Returns the value of attribute id.



2
3
4
# File 'lib/person.rb', line 2

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/person.rb', line 2

def name
  @name
end