Class: Riddl::Wrapper::IOMessages

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby/riddl/wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(min, mout, route = nil, interface = nil) ⇒ IOMessages

{{{



301
302
303
304
305
306
# File 'lib/ruby/riddl/wrapper.rb', line 301

def initialize(min,mout,route=nil,interface=nil)
 @in = min
 @out = mout
 @route = route
 @interface = interface
end

Instance Attribute Details

#inObject (readonly)

Returns the value of attribute in.



327
328
329
# File 'lib/ruby/riddl/wrapper.rb', line 327

def in
  @in
end

#interfaceObject (readonly)

Returns the value of attribute interface.



327
328
329
# File 'lib/ruby/riddl/wrapper.rb', line 327

def interface
  @interface
end

#outObject (readonly)

Returns the value of attribute out.



327
328
329
# File 'lib/ruby/riddl/wrapper.rb', line 327

def out
  @out
end

#routeObject (readonly)

Returns the value of attribute route.



327
328
329
# File 'lib/ruby/riddl/wrapper.rb', line 327

def route
  @route
end

Instance Method Details

#route?Boolean

Returns:

  • (Boolean)


307
308
309
# File 'lib/ruby/riddl/wrapper.rb', line 307

def route?
  !(route.nil? || route.empty?)
end

#route_to_aObject



310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# File 'lib/ruby/riddl/wrapper.rb', line 310

def route_to_a
  if route?
    @route.map do |m|
      if m.class == Riddl::Wrapper::Description::RequestInOut
        Riddl::Wrapper::IOMessages.new(m.in, m.out,nil,m.interface)
      elsif m.class == Riddl::Wrapper::Description::RequestTransformation
        Riddl::Wrapper::IOMessages.new(Riddl::Wrapper::Description::Star.new, Riddl::Wrapper::Description::Star.new,nil,m.interface)
      elsif m.class == Riddl::Wrapper::Description::RequestStarOut
        Riddl::Wrapper::IOMessages.new(Riddl::Wrapper::Description::Star.new, m.out,nil,m.interface)
      elsif m.class == Riddl::Wrapper::Description::RequestPass
        Riddl::Wrapper::IOMessages.new(Riddl::Wrapper::Description::Star.new, Riddl::Wrapper::Description::Star.new,nil,m.interface)
      end
    end
  else
    [self]
  end
end