code: func (r *Resource) inheritMethods(rt *ResourceType, apiDef *APIDefinition) {
  	// inherit all methods from resource type
  	// if it doesn't have the methods, we create it
  	for _, rtm := range rt.methods {
  		m := r.MethodByName(rtm.Name)
  		if m == nil {
  			m = newMethod(rtm.Name)
  			r.assignMethod(m, m.Name)
  		}
  		m.resourceTypeName = r.Type.Name
  		m.inheritFromResourceType(r, rtm, rt, apiDef)
  	}
  
  	// inherit optional methods if only the resource also has the method
  	for _, rtm := range rt.optionalMethods {
  		m := r.MethodByName(rtm.Name)
  		if m == nil {
  			continue
  		}
  		m.resourceTypeName = r.Type.Name
  		m.inheritFromResourceType(r, rtm, rt, apiDef)
  	}
  
  }
docs: // inherit methods inherits all methods based on it's resource type