Class: Cassandra::Types::UserDefined::Field

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameString (readonly)



1172
1173
1174
# File 'lib/cassandra/types.rb', line 1172

def name
  @name
end

#typeCassandra::Type (readonly)



1174
1175
1176
# File 'lib/cassandra/types.rb', line 1174

def type
  @type
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==



1197
1198
1199
1200
1201
# File 'lib/cassandra/types.rb', line 1197

def eql?(other)
  other.is_a?(Field) &&
    @name == other.name &&
    @type == other.type
end

#hashObject



1188
1189
1190
1191
1192
1193
1194
1195
# File 'lib/cassandra/types.rb', line 1188

def hash
  @hash ||= begin
    h = 17
    h = 31 * h + @name.hash
    h = 31 * h + @type.hash
    h
  end
end

#to_sString

String representation of the field



1184
1185
1186
# File 'lib/cassandra/types.rb', line 1184

def to_s
  "#{@name} #{@type}"
end