Class: FSR::App::Fifo

Inherits:
Application show all
Defined in:
lib/fsr/app/fifo.rb

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Application

#app_name, #raw, #sendmsg, #to_s

Constructor Details

- (Fifo) initialize(name, direction = nil, options = nil)

A new instance of Fifo



17
18
19
20
21
22
23
24
# File 'lib/fsr/app/fifo.rb', line 17

def initialize(name, direction = nil, options = nil)
  # These are options that will precede the target address
  @name = name
  @direction = direction || "in"
  raise "Direction must be 'in' or 'out'" unless @direction.match(/^(?:in|out)$/)
  @options = options || {}
  raise "options must be a hash" unless @options.kind_of?(Hash)
end

Instance Attribute Details

- (Object) direction

Returns the value of attribute direction



6
7
8
# File 'lib/fsr/app/fifo.rb', line 6

def direction
  @direction
end

- (Object) name

Returns the value of attribute name



6
7
8
# File 'lib/fsr/app/fifo.rb', line 6

def name
  @name
end

- (Object) options (readonly)

Returns the value of attribute options



7
8
9
# File 'lib/fsr/app/fifo.rb', line 7

def options
  @options
end

Class Method Details

+ (Object) <<(name)



9
10
11
# File 'lib/fsr/app/fifo.rb', line 9

def self.<<(name)
  new(name)
end

+ (Object) >>(name)



13
14
15
# File 'lib/fsr/app/fifo.rb', line 13

def self.>>(name)
  new(name, "out", :wait => true)
end

Instance Method Details

- (Object) arguments



26
27
28
29
30
31
32
# File 'lib/fsr/app/fifo.rb', line 26

def arguments
  @args = [@name, @direction]
  if @direction == "out"
    @args << (options[:wait] ? "wait" : "nowait")
  end
  @args
end