Class: FFWD::Plugin::Loaded
- Inherits:
-
Object
- Object
- FFWD::Plugin::Loaded
- Defined in:
- lib/ffwd/plugin.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #can?(kind) ⇒ Boolean
- #capabilities ⇒ Object
- #get(kind) ⇒ Object
-
#initialize(source, name, options) ⇒ Loaded
constructor
A new instance of Loaded.
Constructor Details
#initialize(source, name, options) ⇒ Loaded
Returns a new instance of Loaded.
23 24 25 26 27 28 29 30 |
# File 'lib/ffwd/plugin.rb', line 23 def initialize source, name, @source = source @name = name @mod = [:mod] @setup_input_method = load_method @mod, [:setup_input_method_name] @setup_output_method = load_method @mod, [:setup_output_method_name] @setup_tunnel_method = load_method @mod, [:setup_tunnel_method_name] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
21 22 23 |
# File 'lib/ffwd/plugin.rb', line 21 def name @name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
21 22 23 |
# File 'lib/ffwd/plugin.rb', line 21 def source @source end |
Instance Method Details
#can?(kind) ⇒ Boolean
50 51 52 |
# File 'lib/ffwd/plugin.rb', line 50 def can?(kind) not get(kind).nil? end |
#capabilities ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ffwd/plugin.rb', line 32 def capabilities capabilities = [] if not @setup_input_method.nil? capabilities << "input" end if not @setup_output_method.nil? capabilities << "output" end if not @setup_tunnel_method.nil? capabilities << "tunnel" end return capabilities end |
#get(kind) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/ffwd/plugin.rb', line 54 def get(kind) return @setup_input_method if kind == :input return @setup_output_method if kind == :output return @setup_tunnel_method if kind == :tunnel return nil end |