Class: Haplocheirus::MockService::MockNode
- Inherits:
-
Struct
- Object
- Struct
- Haplocheirus::MockService::MockNode
- Includes:
- Comparable
- Defined in:
- lib/haplocheirus/mock_service.rb
Constant Summary collapse
- RETWEET_BIT =
31
Instance Attribute Summary collapse
-
#bitfield ⇒ Object
Returns the value of attribute bitfield.
-
#secondary_id ⇒ Object
Returns the value of attribute secondary_id.
-
#status_id ⇒ Object
Returns the value of attribute status_id.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(*args) ⇒ MockNode
constructor
A new instance of MockNode.
- #is_share? ⇒ Boolean
Constructor Details
#initialize(*args) ⇒ MockNode
Returns a new instance of MockNode.
14 15 16 17 |
# File 'lib/haplocheirus/mock_service.rb', line 14 def initialize(*args) super self.bitfield ||= 0 end |
Instance Attribute Details
#bitfield ⇒ Object
Returns the value of attribute bitfield
5 6 7 |
# File 'lib/haplocheirus/mock_service.rb', line 5 def bitfield @bitfield end |
#secondary_id ⇒ Object
Returns the value of attribute secondary_id
5 6 7 |
# File 'lib/haplocheirus/mock_service.rb', line 5 def secondary_id @secondary_id end |
#status_id ⇒ Object
Returns the value of attribute status_id
5 6 7 |
# File 'lib/haplocheirus/mock_service.rb', line 5 def status_id @status_id end |
Class Method Details
.unpack(string) ⇒ Object
10 11 12 |
# File 'lib/haplocheirus/mock_service.rb', line 10 def self.unpack(string) new *string.unpack("QQI") end |
Instance Method Details
#<=>(other) ⇒ Object
19 20 21 |
# File 'lib/haplocheirus/mock_service.rb', line 19 def <=>(other) status_id <=> other.status_id end |
#is_share? ⇒ Boolean
23 24 25 |
# File 'lib/haplocheirus/mock_service.rb', line 23 def is_share? bitfield[RETWEET_BIT] == 1 end |