undefined method `detailsFileTag' for nil:NilClass :     Aim is to test a design pattern -here which is a decorator pattern
    I have taken the below codes from the lib folder , controller folder.
Idea is to test the decorator patter sample code here. 
The library file here has a BasicTag class which is inherited by class TaggingDecor and an another class DescriptionDecor.

Now that all these 3 classes have a common function called 'detailsForTag'.
This function when is called from controller file as listed below.
The error is " undefined method `detailsFileTag' for nil:NilClass" and the error line is as tagged below in the code.
 
    
# the concrete component we would like to decorate
    class BasicTag
    	def initialize()
    		@init_basicTag = "File with no tags"
    	end
    	
    	# getter method
    	def detailsFileTag
    		return " test from BasicTag....."
    	end
    end
    
    # decorator class -- this serves as the superclass for all the concrete decorators
    # the base/super class decorator (i.e. no actual decoration yet), each concrete decorator (i.e. subclass) will add its own decoration
    class TaggingDecor
    	def initialize(r_file)
    		@r_file = r_file
    		@aTagg = "no tag added"
    		@aDescTag = "no description added"
    	end
    
    	# override the details method to include the description of the extra feature
    	def detailsFileTag
    		return @aTagg + @aDescTag
    	end
    end
    
    # a concrete decorator
    class TagDec < TaggingDecor
    	def initialize(r_file)
    		super(r_file)
    		@aTagg = "no tag added"
    		@aDescTag = "tagdec description added"
    	end
    
    # override the details method to include the description
    	def detailsFileTag
    		return @aTagg + @aDescTag 
    	end
    end
    
    # another concrete decorator
    class DescriptionDec < TaggingDecor
    	def initialize(r_file)
    		super(r_file)
    		@aTagg = "no tag added"
    		@aDescTag = "descriptiondec description added"
    	end
    	
    # override the details method to include the description
    	def detailsFileTag
    		return @aTagg + @aDescTag 
    	end
    end
    
    ============================= controller file ============================
    
      # POST /file_taggings
      # POST /file_taggings.json
      def create
        @file_tagging = FileTagging.new(file_tagging_params)
    
    #####################################################
    #rails g scaffold fileTagging filename:string filetag:string filedescription:string
    # information For logging the file details into table
      @file_tagging.filename = params[:file_tagging][:filename]
      @file_tagging.filetag = params[:file_tagging][:filetag]
      @file_tagging.filedescription = params[:file_tagging][:filedescription]
      
    ########################################################################
    # information For logging the file details   
      # create an instance/object of a BasicTag 
        myTagg = BasicTag.new
    
      # add the extra features to the new car
        if params[:file_tagging][:filetag].to_s.length > 0 then
          myTagg = TagDec.new(myTagg)
        end
        
        #if params[:file_tagging][:description].to_s.length > 0 then
        #  myTagg = DescriptionDec.new(myTagg)
        #end
    
        ## populate the Description details - By calling the BASE class and SUPER class as stated above.
    #Error is here for the call myTagg.detailsFileTag !
        @file_tagging.filedescription =  myTagg.detailsFileTag
    
       # retrieve the instance/object of the MyLogger class
      logger = MyLogger.instance
      logger.logInformation("A new file details are: " +  @file_tagging.filesdescription)
      logger.logInformation("A new file details are: ")
    #####################################################
    
    
        respond_to do |format|
          if @file_tagging.save
            format.html { redirect_to @file_tagging, notice: 'File tagging was successfully created.' }
            format.json { render :show, status: :created, location: @file_tagging }
          else
            format.html { render :new }
            format.json { render json: @file_tagging.errors, status: :unprocessable_entity }
          end
        end
      end
    ============================================================