Skip to content

Instantly share code, notes, and snippets.

@joseluistorres
Created January 24, 2014 15:23
Show Gist options
  • Select an option

  • Save joseluistorres/8599387 to your computer and use it in GitHub Desktop.

Select an option

Save joseluistorres/8599387 to your computer and use it in GitHub Desktop.
Herencia - Parte 5
class Taco
attr_reader :maiz_o_harina, :cebolla, :cilantro
def initialize(args)
@maiz_o_harina = args[:maiz_o_harina]
@cebolla = args[:cebolla] || con_cebolla
@cilantro = args[:cilantro] || con_cilantro
inicializa_despues(args)
end
def verdura
{ cebolla: cebolla,
:cilantro cilantro}.merge(otras_verduras)
end
def con_cebolla
'si'
end
def con_cilantro
'si'
end
def inicializa_despues(args)
nil
end
def otras_verduras
{}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment