class BlandAltman

Public Class Methods

new(group,value,params) click to toggle source
# File lib/bland_altman/bland_altman.rb, line 2
def initialize(group,value,params)
        @group=check_val(group)
        @value=check_val(value)
        @params=self.check_par(params)
end

Public Instance Methods

check_par(params) click to toggle source
# File lib/bland_altman/bland_altman.rb, line 8
def check_par(params)
        hash = Hash.new
        permitted = ["title","vertical","legend","width","height","file_name"]
        keys = params.keys
        keys.each{ |key|
                 if permitted.include?(key)==false
                        raise "Error : Permitted key are title,vertical,legend,width,height"
                end
        }
        
        if params["title"]==nil
                hash["title"]="A sample Graph"
        else
                 hash["title"]=params["title"]
        end

        if params["vertical"]==nil
                hash["vertical"]=false
        else
                hash["vertical"]=params["vertical"]
        end

       if params["legend"]==nil
                hash["legend"]=false
        else
                hash["legend"]=params["legend"]
        end

        if params["width"]==nil
                hash["width"]=1500
        else
                hash["width"]=params["width"]
        end

        if params["height"]==nil
                hash["height"]=800
        else
                hash["height"]=params["height"]
        end

        if params["file_name"]==nil
                hash["file_name"]="sample.jpg"
        else
                hash["file_name"]=params["file_name"]
        end

        params_map = HashMap.new(hash)
        return params_map
end
getGroup() click to toggle source
# File lib/bland_altman/bland_altman.rb, line 58
def getGroup
        @group
end
getParams() click to toggle source
# File lib/bland_altman/bland_altman.rb, line 66
 def getParams
        @params
end
getValue() click to toggle source
# File lib/bland_altman/bland_altman.rb, line 62
def getValue
        @value 
end
save() click to toggle source
# File lib/bland_altman/bland_altman.rb, line 71
def save
        begin
                a = Java::ComDomain::clocomics
                a.save_altman(self.getGroup,self.getValue,self.getParams)
        rescue Exception => ex
        end
end
view() click to toggle source
# File lib/bland_altman/bland_altman.rb, line 78
def view
         begin
                a = Java::ComDomain::clocomics
                a.view_altman(self.getGroup,self.getValue,self.getParams)
        rescue Exception => ex
        end
end