Added FriendlyHash for orders, refactored Order#execute arguments

This commit is contained in:
2019-10-03 11:45:58 -05:00
parent 3dd067612a
commit fd3b847449
6 changed files with 78 additions and 10 deletions

23
lib/friendly_hash.rb Normal file
View File

@@ -0,0 +1,23 @@
class IMICRTS
class FriendlyHash
def initialize
@hash = {}
end
def [](key)
@hash[key.to_sym]
end
def []=(key, value)
@hash[key.to_sym] = value
end
def method_missing(method)
if value = @hash.dig(method)
value
else
raise "Unknown value for: #{method}"
end
end
end
end