Class: DSKTrackSector
- Inherits:
-
Object
- Object
- DSKTrackSector
- Defined in:
- lib/DSK.rb
Instance Attribute Summary collapse
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#sector_no ⇒ Object
Returns the value of attribute sector_no.
-
#track_no ⇒ Object
Returns the value of attribute track_no.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(track_no, sector_no, offset = 0x00) ⇒ DSKTrackSector
constructor
A new instance of DSKTrackSector.
- #to_s ⇒ Object
Constructor Details
#initialize(track_no, sector_no, offset = 0x00) ⇒ DSKTrackSector
Returns a new instance of DSKTrackSector.
318 319 320 321 322 |
# File 'lib/DSK.rb', line 318 def initialize(track_no,sector_no,offset=0x00) @track_no=track_no @sector_no=sector_no @offset=offset end |
Instance Attribute Details
#offset ⇒ Object
Returns the value of attribute offset.
317 318 319 |
# File 'lib/DSK.rb', line 317 def offset @offset end |
#sector_no ⇒ Object
Returns the value of attribute sector_no.
317 318 319 |
# File 'lib/DSK.rb', line 317 def sector_no @sector_no end |
#track_no ⇒ Object
Returns the value of attribute track_no.
317 318 319 |
# File 'lib/DSK.rb', line 317 def track_no @track_no end |
Instance Method Details
#<=>(other) ⇒ Object
327 328 329 330 331 332 |
# File 'lib/DSK.rb', line 327 def <=>(other) return -1 unless other.kind_of?DSKTrackSector return track_no<=>other.track_no unless track_no==other.track_no return sector_no<=>other.sector_no unless sector_no==other.sector_no return offset<=>other.offset end |
#to_s ⇒ Object
323 324 325 |
# File 'lib/DSK.rb', line 323 def to_s sprintf "TRACK $%02X SECTOR $%02X OFFSET $02X",track_no,sector_no,offset end |