Class: RTM::TMQL::TMQL4JEngine
Constant Summary collapse
- @@version =
nil
Instance Attribute Summary collapse
-
#runtime ⇒ Object
readonly
Returns the value of attribute runtime.
-
#runtime_setting ⇒ Object
readonly
Returns the value of attribute runtime_setting.
-
#topic_map ⇒ Object
readonly
Returns the value of attribute topic_map.
Class Method Summary collapse
-
.version ⇒ Object
Returns the version of the underlying TMQL4J version It’s a bit of a hack.
Instance Method Summary collapse
- #enable_materialize_meta_model(materialize) ⇒ Object
- #enable_updates(enabled) ⇒ Object
- #execute(query) ⇒ Object
-
#initialize(topic_map, params = {}) ⇒ TMQL4JEngine
constructor
A new instance of TMQL4JEngine.
- #properties ⇒ Object
Methods inherited from Engine
Constructor Details
#initialize(topic_map, params = {}) ⇒ TMQL4JEngine
Returns a new instance of TMQL4JEngine.
7 8 9 10 11 12 |
# File 'lib/rtm/tmql/tmql4j.rb', line 7 def initialize(topic_map, params={}) raise("topic_map must be a RTM::TopicMap") unless topic_map.is_a?(RTM::TopicMap) super(params) #@params is set @topic_map = topic_map @runtime_setting = set_runtime end |
Instance Attribute Details
#runtime ⇒ Object (readonly)
Returns the value of attribute runtime.
4 5 6 |
# File 'lib/rtm/tmql/tmql4j.rb', line 4 def runtime @runtime end |
#runtime_setting ⇒ Object (readonly)
Returns the value of attribute runtime_setting.
4 5 6 |
# File 'lib/rtm/tmql/tmql4j.rb', line 4 def runtime_setting @runtime_setting end |
#topic_map ⇒ Object (readonly)
Returns the value of attribute topic_map.
4 5 6 |
# File 'lib/rtm/tmql/tmql4j.rb', line 4 def topic_map @topic_map end |
Class Method Details
.version ⇒ Object
Returns the version of the underlying TMQL4J version It’s a bit of a hack.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rtm/tmql/tmql4j.rb', line 33 def self.version unless @@version javalibs_directory = File.join(File.dirname(__FILE__), 'javalibs') if File.directory?(javalibs_directory) tmql_files = Dir[File.join(javalibs_directory + '/tmql4j-*.jar')] tmql_files = tmql_files.reject{|file| file.include?("tmml")} if tmql_files.size == 1 file = tmql_files.first @@version = File.basename(file, ".jar").gsub("tmql4j-", "") end end end return @@version end |
Instance Method Details
#enable_materialize_meta_model(materialize) ⇒ Object
18 19 20 |
# File 'lib/rtm/tmql/tmql4j.rb', line 18 def (materialize) properties.enableMaterializeMetaModel(materialize) end |
#enable_updates(enabled) ⇒ Object
22 23 24 |
# File 'lib/rtm/tmql/tmql4j.rb', line 22 def enable_updates(enabled) properties.enableLanguageExtensionTmqlUl(enabled) end |
#execute(query) ⇒ Object
26 27 28 29 |
# File 'lib/rtm/tmql/tmql4j.rb', line 26 def execute(query) q = runtime.run(query) q.results end |
#properties ⇒ Object
14 15 16 |
# File 'lib/rtm/tmql/tmql4j.rb', line 14 def properties runtime.properties end |