Class: Person

Inherits:
Pal
  • Object
show all
Defined in:
lib/sw_info.rb

Overview

En esta clase voy a querer acceder a esa data dependiendo de la key que me pase y mostrar el atributo que se pida según el método llamado

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Pal

all, find, #id, #initialize, #name, search_for_all, search_for_id, #to_s

Constructor Details

This class inherits a constructor from Pal

Instance Attribute Details

#aliasObject

Returns the value of attribute alias.



69
70
71
# File 'lib/sw_info.rb', line 69

def alias
  @alias
end

#dataObject

Returns the value of attribute data.



69
70
71
# File 'lib/sw_info.rb', line 69

def data
  @data
end

Instance Method Details

#birth_yearObject



71
72
73
# File 'lib/sw_info.rb', line 71

def birth_year
    @data['birth_year']
end

#eye_colorObject



75
76
77
# File 'lib/sw_info.rb', line 75

def eye_color
    @data['eye_color']
end

#genderObject



95
96
97
# File 'lib/sw_info.rb', line 95

def gender
    @data['gender']
end

#hair_colorObject



79
80
81
# File 'lib/sw_info.rb', line 79

def hair_color
    @data['hair_color']
end

#heightObject



87
88
89
# File 'lib/sw_info.rb', line 87

def height
    @data['height']
end

#massObject



91
92
93
# File 'lib/sw_info.rb', line 91

def mass
    @data['mass']
end

#skin_colorObject



83
84
85
# File 'lib/sw_info.rb', line 83

def skin_color
    @data['skin_color']
end