module Sbuilder ## # Interface paramter set model interfaces. An interface is # identified by path+operations (e.g. /customer(get) ). # # Method #parameters return input to the interface, and #response # -method output from the interface service. # # class ParamSet_If < ParamSet attr_reader :path # REST path attr_reader :operation # REST path # @attr [ParamSet] response parameter set attr_reader :response # @attr [Boolean] infrastructureService true when generate support # to return response from interface service. attr_reader :infrastructureService # default 'false' # @attr [Boolean] interfaceService true when generates interface # process attr_reader :interfaceService # ------------------------------------------------------------------ # mixer PROGNAME = nil # progname for logger default class name include Sbuilder::Utils::MyLogger # mix logger # ------------------------------------------------------------------ # constrcutore def initialize( options = {} ) super( options ) @logger = getLogger( PROGNAME, options ) @logger.debug( "#{__method__} initialized" ) @response = nil # default: generate interface processes, no support for response return setInterfaceService( true ) setInfrastructureService( false ) end # ------------------------------------------------------------------ # configure # def addResponse( response ) # @responses << response # self # end def setResponse( response ) @response = response self end ## # Rendering generates interface procesess when true # def setInterfaceService( interfaceService ) @interfaceService = interfaceService self end ## # Rendering generates support to return values from infrastructure # service. def setInfrastructureService( infrastructureService ) @infrastructureService = infrastructureService self end # @return [Parameter:Array] parameters including # response.parameters, if any def parametersToResolve parameters + (response.nil? ? [] : response.parameters) end # ------------------------------------------------------------------ # setIdentity # set identity def setIdentity( path, operation ) @path = path @operation = operation self end # return identity def doGetId "#{path}(#{operation})" end def isArray return false end end end