Module: VirtDisk::ExportMethods::ClassMethods
- Defined in:
- lib/virt_disk/export_methods.rb
Instance Method Summary collapse
-
#export(*syms) ⇒ Object
Export one or more methods, making them callable from the volume head.
-
#exported?(sym) ⇒ Boolean
-
true if sym is exported by this class, false otherwise.
-
-
#exports ⇒ Array<Symbol>
Array of exported methods.
Instance Method Details
#export(*syms) ⇒ Object
Export one or more methods, making them callable from the volume head.
18 19 20 21 22 23 24 25 26 |
# File 'lib/virt_disk/export_methods.rb', line 18 def export(*syms) syms.each do |s| sym = s.to_sym raise "Method not defined in class: #{sym}" unless method_defined?(sym) return nil if exports.include?(sym) exports << sym end nil end |
#exported?(sym) ⇒ Boolean
Returns - true if sym is exported by this class, false otherwise.
35 36 37 |
# File 'lib/virt_disk/export_methods.rb', line 35 def exported?(sym) exports.include?(sym.to_sym) end |
#exports ⇒ Array<Symbol>
Returns array of exported methods.
29 30 31 |
# File 'lib/virt_disk/export_methods.rb', line 29 def exports @__exported_methods ||= [] end |