Class: CassandraSnapshot

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clusterObject (readonly)

Returns the value of attribute cluster.



139
140
141
# File 'lib/cassandra.rb', line 139

def cluster
  @cluster
end

#dateObject (readonly)

Returns the value of attribute date.



139
140
141
# File 'lib/cassandra.rb', line 139

def date
  @date
end

#metadataObject (readonly)

Returns the value of attribute metadata.



139
140
141
# File 'lib/cassandra.rb', line 139

def 
  
end

#nodeObject (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_dateObject



167
168
169
# File 'lib/cassandra.rb', line 167

def get_date
  DateTime.strptime(@date, '%Y_%m_%d')
end

#to_sObject



152
153
154
# File 'lib/cassandra.rb', line 152

def to_s
  "[#{@cluster}|#{@node}|#{@date}]"
end