Module: Yast::Exportable
- Included in:
- Module
- Defined in:
- src/ruby/yast/exportable.rb
Overview
Provides ability to export functions and variables to Yast component system. The most important method is #publish
Defined Under Namespace
Modules: ExceptionReporter
Class Method Summary collapse
-
.extended(mod) ⇒ Object
Extend by ExceptionReporter to allow exported module report last exception.
Instance Method Summary collapse
-
#publish(options) ⇒ Object
Publishes function or variable to component system.
-
#published_functions ⇒ Array<Array(Symbol,String)>
private
List of published functions.
-
#published_variables ⇒ Array<Array(Symbol,String)>
private
List of published variables.
Class Method Details
.extended(mod) ⇒ Object
Extend by ExceptionReporter to allow exported module report last exception
63 64 65 |
# File 'src/ruby/yast/exportable.rb', line 63 def self.extended(mod) mod.send(:include, ExceptionReporter) end |
Instance Method Details
#publish(options) ⇒ Object
mandatory options are :type and :variable xor :function. Both together is not supported
Publishes function or variable to component system
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'src/ruby/yast/exportable.rb', line 38 def publish() raise "Missing signature" unless [:type] # convert type to full specification type = [:type].delete " \t" type.gsub!(/map([^<]|$)/, 'map<any,any>\\1') type.gsub!(/list([^<]|$)/, 'list<any>\\1') if [:function] published_functions.push([[:function], type]) elsif [:variable] published_variables.push([[:variable], type]) attr_accessor [:variable] else raise "Missing publish kind" end end |
#published_functions ⇒ Array<Array(Symbol,String)>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns list of published functions.
14 15 16 |
# File 'src/ruby/yast/exportable.rb', line 14 def published_functions @__published_functions ||= [] end |
#published_variables ⇒ Array<Array(Symbol,String)>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns list of published variables.
25 26 27 |
# File 'src/ruby/yast/exportable.rb', line 25 def published_variables @__published_variables ||= [] end |