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, config) ⇒ Loaded

Returns a new instance of Loaded.



23
24
25
26
27
28
29
30
31
32
# File 'lib/ffwd/plugin.rb', line 23

def initialize source, name, config
  @source = source
  @name = name
  @mod = config[:mod]
  @description = config[:description]
  @options = config[:options]
  @setup_input_method = load_method @mod, config[:setup_input_method_name]
  @setup_output_method = load_method @mod, config[:setup_output_method_name]
  @setup_tunnel_method = load_method @mod, config[:setup_tunnel_method_name]
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
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)


52
53
54
# File 'lib/ffwd/plugin.rb', line 52

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

#capabilitiesObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ffwd/plugin.rb', line 34

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



56
57
58
59
60
61
# File 'lib/ffwd/plugin.rb', line 56

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