Module: LibComponent::Pin

Included in:
Input, Output
Defined in:
lib/openplacos/libcomponent.rb

Overview

Common module to Input and Output

Instance Method Summary collapse

Instance Method Details

#buffer=(time_) ⇒ Object



36
37
38
39
40
# File 'lib/openplacos/libcomponent.rb', line 36

def buffer=(time_)
  self.extend(Buffer)
  @buffer_time = time_
  @buffer_last_value = Time.new(0)
end

#introspectObject

Return introspect object that can be delivered to openplacos server



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/openplacos/libcomponent.rb', line 20

def introspect
  iface = Hash.new
  pin = Hash.new
  meth = Array.new
  
  if self.respond_to?(:read)
    meth << "read"
  end
  if self.respond_to?(:write)
    meth << "write"
  end
  iface[@interface] = meth
  pin[@name] = iface
  return pin
end

#set_component(component_) ⇒ Object



15
16
17
# File 'lib/openplacos/libcomponent.rb', line 15

def set_component(component_)
  @component=component_
end