Class: CassandraSnapshot
- Inherits:
-
Object
- Object
- CassandraSnapshot
- Defined in:
- lib/cassandra.rb
Instance Attribute Summary collapse
-
#cluster ⇒ Object
readonly
Returns the value of attribute cluster.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
- #get_date ⇒ Object
-
#initialize(cluster, node, date, metadata = nil) ⇒ CassandraSnapshot
constructor
A new instance of CassandraSnapshot.
- #to_s ⇒ Object
Constructor Details
#initialize(cluster, node, date, metadata = nil) ⇒ CassandraSnapshot
Returns a new instance of CassandraSnapshot.
141 142 143 144 145 146 147 148 149 150 |
# File 'lib/cassandra.rb', line 141 def initialize(cluster, node, date, = nil) @cluster = cluster @node = node @date = date = if .nil? Set.new else end end |
Instance Attribute Details
#cluster ⇒ Object (readonly)
Returns the value of attribute cluster.
139 140 141 |
# File 'lib/cassandra.rb', line 139 def cluster @cluster end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
139 140 141 |
# File 'lib/cassandra.rb', line 139 def date @date end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
139 140 141 |
# File 'lib/cassandra.rb', line 139 def end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
139 140 141 |
# File 'lib/cassandra.rb', line 139 def node @node end |
Instance Method Details
#<=>(other) ⇒ Object
160 161 162 163 164 165 |
# File 'lib/cassandra.rb', line 160 def <=>(other) c = @cluster <=> other.cluster n = @node <=> other.node d = @date <=> other.date c * 3 + n * 2 + d end |
#==(other) ⇒ Object
156 157 158 |
# File 'lib/cassandra.rb', line 156 def ==(other) @cluster == other.cluster && @node == other.node && @date == other.date end |
#get_date ⇒ Object
167 168 169 |
# File 'lib/cassandra.rb', line 167 def get_date DateTime.strptime(@date, '%Y_%m_%d') end |
#to_s ⇒ Object
152 153 154 |
# File 'lib/cassandra.rb', line 152 def to_s "[#{@cluster}|#{@node}|#{@date}]" end |