Class: Cassandra::Types::Custom
- Inherits:
-
Cassandra::Type
- Object
- Cassandra::Type
- Cassandra::Types::Custom
- Defined in:
- lib/cassandra/types.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#assert(value, message = nil, &block) ⇒ void
Asserts that a given value is of this type.
-
#initialize(name) ⇒ Custom
constructor
A new instance of Custom.
-
#kind ⇒ Symbol
Shorthand type name.
-
#new(*value) ⇒ Object
Coerces a given value to this type.
-
#to_s ⇒ String
A cassandra representation of this type.
Constructor Details
#initialize(name) ⇒ Custom
Returns a new instance of Custom.
1173 1174 1175 |
# File 'lib/cassandra/types.rb', line 1173 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
1171 1172 1173 |
# File 'lib/cassandra/types.rb', line 1171 def name @name end |
Instance Method Details
#assert(value, message = nil, &block) ⇒ void
This method returns an undefined value.
Asserts that a given value is of this type
1196 1197 1198 |
# File 'lib/cassandra/types.rb', line 1196 def assert(value, = nil, &block) raise ::NotImplementedError, "unable to assert a value for custom type: #{@name.inspect}" end |
#kind ⇒ Symbol
Returns shorthand type name.
1178 1179 1180 |
# File 'lib/cassandra/types.rb', line 1178 def kind :custom end |
#new(*value) ⇒ Object
Coerces a given value to this type
1186 1187 1188 |
# File 'lib/cassandra/types.rb', line 1186 def new(*value) raise ::NotImplementedError, "unable to create a value for custom type: #{@name.inspect}" end |
#to_s ⇒ String
Returns a cassandra representation of this type.
1201 1202 1203 |
# File 'lib/cassandra/types.rb', line 1201 def to_s "custom: #{@name}" end |