Class: CassandraCQL::ColumnFamily
- Inherits:
-
Object
- Object
- CassandraCQL::ColumnFamily
show all
- Defined in:
- lib/cassandra-cql/schema.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ColumnFamily.
54
55
56
|
# File 'lib/cassandra-cql/schema.rb', line 54
def initialize(cf_def)
@cf_def = cf_def
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
58
59
60
61
62
63
64
|
# File 'lib/cassandra-cql/schema.rb', line 58
def method_missing(method, *args, &block)
if @cf_def.respond_to?(method)
@cf_def.send(method)
else
super(method, *args, &block)
end
end
|
Instance Attribute Details
#cf_def ⇒ Object
Returns the value of attribute cf_def.
52
53
54
|
# File 'lib/cassandra-cql/schema.rb', line 52
def cf_def
@cf_def
end
|
Class Method Details
.cast(value, type) ⇒ Object
Instance Method Details
#columns ⇒ Object
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/cassandra-cql/schema.rb', line 66
def columns
return @columns if @columns
@columns = Hash.new(default_validation_class)
@cf_def.column_metadata.each do |col|
@columns[col.name] = col.validation_class
end
@columns[key_alias] = key_validation_class
@columns
end
|
#id ⇒ Object
96
97
98
|
# File 'lib/cassandra-cql/schema.rb', line 96
def id
@cf_def.id
end
|
#name ⇒ Object
88
89
90
|
# File 'lib/cassandra-cql/schema.rb', line 88
def name
@cf_def.name
end
|
#standard? ⇒ Boolean
100
101
102
|
# File 'lib/cassandra-cql/schema.rb', line 100
def standard?
type == 'Standard'
end
|
#super? ⇒ Boolean
104
105
106
|
# File 'lib/cassandra-cql/schema.rb', line 104
def super?
type == 'Super'
end
|
#type ⇒ Object
92
93
94
|
# File 'lib/cassandra-cql/schema.rb', line 92
def type
@cf_def.column_type
end
|