Class: SimplerTiles::VectorLayer
- Inherits:
-
Object
- Object
- SimplerTiles::VectorLayer
- Includes:
- PP
- Defined in:
- lib/simpler_tiles/layer/vector_layer.rb,
ext/simpler_tiles/vector_layer.c
Overview
The VectorLayer object contains connection info for a particular datasource and tracks a list of Querys.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(source) {|_self| ... } ⇒ VectorLayer
constructor
A new instance of VectorLayer.
-
#query(sql, &blk) ⇒ Object
Add a query to this Layer’s c list.
-
#source ⇒ String
Get a copy of the Layer’s source.
-
#source=(source) ⇒ String
Set the source attribute for the Layer.
Methods included from PP
Constructor Details
#initialize(source) {|_self| ... } ⇒ VectorLayer
Returns a new instance of VectorLayer.
7 8 9 10 |
# File 'lib/simpler_tiles/layer/vector_layer.rb', line 7 def initialize(source) self.source = source yield self if block_given? end |
Instance Method Details
#query(sql, &blk) ⇒ Object
Add a query to this Layer’s c list.
13 14 15 16 |
# File 'lib/simpler_tiles/layer/vector_layer.rb', line 13 def query(sql, &blk) layer = SimplerTiles::Query.new(sql, &blk) add_query layer end |
#source ⇒ String
Get a copy of the Layer’s source.
31 32 33 34 35 36 37 |
# File 'ext/simpler_tiles/layer.c', line 31 VALUE get_source(VALUE self) { simplet_layer_t *layer = get_layer(self); char *source; simplet_layer_get_source(layer, &source); return rb_str_new2(source); } |
#source=(source) ⇒ String
Set the source attribute for the Layer.
18 19 20 21 22 23 24 |
# File 'ext/simpler_tiles/layer.c', line 18
VALUE
set_source(VALUE self, VALUE source){
Check_Type(source, T_STRING);
simplet_layer_t *layer = get_layer(self);
simplet_layer_set_source(layer, RSTRING_PTR(source));
return source;
}
|