Class: Person
- Inherits:
-
Object
- Object
- Person
- Defined in:
- lib/person.rb
Instance Attribute Summary collapse
-
#club ⇒ Object
readonly
Returns the value of attribute club.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(data) ⇒ Person
constructor
A new instance of Person.
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
#club ⇒ Object (readonly)
Returns the value of attribute club.
2 3 4 |
# File 'lib/person.rb', line 2 def club @club end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/person.rb', line 2 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/person.rb', line 2 def name @name end |