Method: Mackerel::Organization#to_h
- Defined in:
- lib/mackerel/organization.rb
#to_h ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/mackerel/organization.rb', line 8 def to_h instance_variables.flat_map do |name| respond_to?(name[1..-1]) ? [name[1..-1]] : [] end.each_with_object({}) do |name, hash| hash[name] = public_send(name) end.delete_if { |key, val| val == nil } end |