class Alchy::Offspring

Attributes

child[RW]
father[RW]
mother[RW]

Public Class Methods

new(mother: "", father: "") click to toggle source
# File lib/alchy/offspring.rb, line 5
def initialize(mother: "", father: "")
  self.mother = mother
  self.father = father
end

Public Instance Methods

create() click to toggle source
# File lib/alchy/offspring.rb, line 10
def create
  child = find
  unless child.nil?
    puts "New element, #{child} 🎉"
    self.child = child
    return child
  end
end

Private Instance Methods

find() click to toggle source
# File lib/alchy/offspring.rb, line 20
def find
  Alchy::ELEMENTS[mother].to_h[father] || Alchy::ELEMENTS[father].to_h[mother]
end