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

{{{



276
277
278
279
280
281
# File 'lib/ruby/riddl/wrapper.rb', line 276

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.



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

def in
  @in
end

#interfaceObject (readonly)

Returns the value of attribute interface.



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

def interface
  @interface
end

#outObject (readonly)

Returns the value of attribute out.



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

def out
  @out
end

#routeObject (readonly)

Returns the value of attribute route.



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

def route
  @route
end

Instance Method Details

#route?Boolean

Returns:

  • (Boolean)


282
283
284
# File 'lib/ruby/riddl/wrapper.rb', line 282

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

#route_to_aObject



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/ruby/riddl/wrapper.rb', line 285

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