class Datasets::Hepatitis::Record

Public Class Methods

new(*values) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 27
def initialize(*values)
  super()
  members.zip(values) do |member, value|
    __send__("#{member}=", value)
  end
end

Public Instance Methods

age=(age) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 45
def age=(age)
  super(normalize_integer(age))
end
albumin=(albumin) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 116
def albumin=(albumin)
  super(normalize_float(albumin))
end
alkaline_phosphate=(alkaline_phosphate) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 108
def alkaline_phosphate=(alkaline_phosphate)
  super(normalize_integer(alkaline_phosphate))
end
anorexia=(anorexia) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 76
def anorexia=(anorexia)
  super(normalize_boolean(anorexia))
end
antivirals=(antivirals) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 64
def antivirals=(antivirals)
  super(normalize_boolean(antivirals))
end
ascites=(ascites) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 96
def ascites=(ascites)
  super(normalize_boolean(ascites))
end
bilirubin=(bilirubin) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 104
def bilirubin=(bilirubin)
  super(normalize_float(bilirubin))
end
fatigue=(fatigue) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 68
def fatigue=(fatigue)
  super(normalize_boolean(fatigue))
end
histology=(histology) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 124
def histology=(histology)
  super(normalize_boolean(histology))
end
label=(label) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 34
def label=(label)
  case label
  when "1"
    super(:die)
  when "2"
    super(:live)
  else
    super(label)
  end
end
liver_big=(liver_big) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 80
def liver_big=(liver_big)
  super(normalize_boolean(liver_big))
end
liver_firm=(liver_firm) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 84
def liver_firm=(liver_firm)
  super(normalize_boolean(liver_firm))
end
malaise=(malaise) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 72
def malaise=(malaise)
  super(normalize_boolean(malaise))
end
protime=(protime) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 120
def protime=(protime)
  super(normalize_integer(protime))
end
sex=(sex) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 49
def sex=(sex)
  case sex
  when "1"
    super(:male)
  when "2"
    super(:female)
  else
    super(sex)
  end
end
sgot=(sgot) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 112
def sgot=(sgot)
  super(normalize_integer(sgot))
end
spiders=(spiders) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 92
def spiders=(spiders)
  super(normalize_boolean(spiders))
end
spleen_palpable=(spleen_palpable) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 88
def spleen_palpable=(spleen_palpable)
  super(normalize_boolean(spleen_palpable))
end
steroid=(steroid) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 60
def steroid=(steroid)
  super(normalize_boolean(steroid))
end
varices=(varices) click to toggle source
Calls superclass method
# File lib/datasets/hepatitis.rb, line 100
def varices=(varices)
  super(normalize_boolean(varices))
end

Private Instance Methods

normalize_boolean(value) click to toggle source
# File lib/datasets/hepatitis.rb, line 129
def normalize_boolean(value)
  case value
  when "?"
    nil
  when "1"
    false
  when "2"
    true
  else
    value
  end
end
normalize_float(value) click to toggle source
# File lib/datasets/hepatitis.rb, line 142
def normalize_float(value)
  case value
  when "?"
    nil
  else
    Float(value)
  end
end
normalize_integer(value) click to toggle source
# File lib/datasets/hepatitis.rb, line 151
def normalize_integer(value)
  case value
  when "?"
    nil
  else
    Integer(value, 10)
  end
end