Skip to content

Instantly share code, notes, and snippets.

@lucasrenan
Created July 16, 2015 02:40
Show Gist options
  • Save lucasrenan/6acfc8dfd735a4170bac to your computer and use it in GitHub Desktop.
Save lucasrenan/6acfc8dfd735a4170bac to your computer and use it in GitHub Desktop.
class Device
CONSUMPTIONS = {
"1" => { method_id: 2, value: 20 },
"2" => { method_id: 6, value: 0.001 },
"3" => { method_id: 7, value: 30 }
}
end
puts Device::CONSUMPTIONS["2"][:method_id] # => 6
puts Device::CONSUMPTIONS["2"][:value] # => 0.001
puts Device::CONSUMPTIONS.inspect # => {"1"=>{:method_id=>2, :value=>20}, "2"=>{:method_id=>6, :value=>0.001}, "3"=>{:method_id=>7, :value=>30}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment