'Set method based on state parameter'

def define_method(self):

    if self.params['method']:
        if self.module.argument_spec('state', False):
            self.module.deprecate("Parameter    'method'    or    'action'    is    deprecated,    please    use    'state'    instead", '2.6')
        method_map = dict(delete='absent', get='query', post='present')
        self.params['state'] = method_map[self.params['method']]
    else:
        state_map = dict(absent='delete', present='post', query='get')
        self.params['method'] = state_map[self.params['state']]
