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
# 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]
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)


47
48
49
# File 'lib/ffwd/plugin.rb', line 47

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

#capabilitiesObject



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/ffwd/plugin.rb', line 33

def capabilities
  capabilities = []

  if not @setup_input_method.nil?
    capabilities << "input"
  end

  if not @setup_output_method.nil?
    capabilities << "output"
  end

  return capabilities
end

#get(kind) ⇒ Object



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

def get(kind)
  return @setup_input_method if kind == :input
  return @setup_output_method if kind == :output
  return nil
end