support/ruby/collins-notify/lib/collins_notify/notifier.rb
def fetch_mo_option mo, key, default
      value = default
      if mo.is_a?(Hash) && mo.key?(key) && !mo[key].nil? then
        value = mo[key]
      elsif mo.respond_to?(key) && !mo.send(key).nil? then
        value = mo.send(key)
      end
      value
    end
# Retrieve (safely) a key from a message object which may be a hash, OpenStruct, or arbitrary
# value
Retrieve (safely) a key from a message object which may be a hash, OpenStruct, or arbitrary
value
Retrieve ( safely ) a key from a message object which may be a hash OpenStruct or arbitrary value
def fetch_mo_option mo, key, default
      value = default
      if mo.is_a?(Hash) && mo.key?(key) && !mo[key].nil? then
        value = mo[key]
      elsif mo.respond_to?(key) && !mo.send(key).nil? then
        value = mo.send(key)
      end
      value
    end
def fetch_mo_option mo , key , default value = default if mo . is_a? ( Hash ) && mo . key? ( key ) && ! mo [ key ] . nil? then value = mo [ key ] elsif mo . respond_to? ( key ) && ! mo . send ( key ) . nil? then value = mo . send ( key ) end value end
Retrieve (safely) a key from a message object which may be a hash, OpenStruct, or arbitrary
value
Retrieve ( safely ) a key from a message object which may be a hash OpenStruct or arbitrary value
mo
key
default