Module: Dogviz::Nominator

Included in:
Container, System, Thing
Defined in:
lib/dogviz/nominator.rb

Instance Method Summary collapse

Instance Method Details

#nominate(names_to_nominees) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/dogviz/nominator.rb', line 3

def nominate(names_to_nominees)
  names_to_nominees.each { |name, nominee|
    define_singleton_method sanitized_name(name) do
      nominee
    end
  }
end

#nominate_from(nominee_nominator, *nominee_names) ⇒ Object



11
12
13
14
15
16
# File 'lib/dogviz/nominator.rb', line 11

def nominate_from(nominee_nominator, *nominee_names)
  nominee_names.each { |name|
    accessor_sym = name.to_s.to_sym
    nominate accessor_sym => nominee_nominator.send(accessor_sym)
  }
end