Class: FFWD::Plugin::Loaded

Inherits:
Object
  • Object
show all
Defined in:
lib/ffwd/plugin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options
  @source = source
  @name = name
  @mod = options[:mod]
  @setup_input_method = load_method @mod, options[:setup_input_method_name]
  @setup_output_method = load_method @mod, options[:setup_output_method_name]
  @setup_tunnel_method = load_method @mod, options[:setup_tunnel_method_name]
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



21
22
23
# File 'lib/ffwd/plugin.rb', line 21

def name
  @name
end

#sourceObject (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

Returns:

  • (Boolean)


50
51
52
# File 'lib/ffwd/plugin.rb', line 50

def can?(kind)
  not get(kind).nil?
end

#capabilitiesObject



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