-
Notifications
You must be signed in to change notification settings - Fork 26
Introducing Tomdoc #31
base: master
Are you sure you want to change the base?
Conversation
# to pass different params for the same, e.g: send user instead of username | ||
# | ||
# Do not modify this behavior. Those inconsistencies will be worked | ||
# internally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message we are trying to convey here is: always use the same name for keys/variables for our library. If we use username
on one method, we use it for all of them. Example:
def whatever(options = {})
api_request(username: options[:username])
end
def hello(options = {})
api_request(user: options[:username])
end
Note how we send user
in one method and username
in the other, but out API methods ask for username
for both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we stick with this behavior for everything, right?
Take this key as an example: "rCFG". It means nothing outside a scope and I think everything should be translated for a more readable version.
What about the interdependent keys? If we went to DNS zone records modules, there are some keys that depend on each other, e.g: txtdata is an optional string but it's required if we're dealing with a TXT record. Docs would be enough here? Or it would be better to work those values inside methods?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the specific API calls you are referring to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at this one - http://docs.cpanel.net/twiki/bin/view/ApiDocs/Api2/ApiZoneEdit#ZoneEdit::add_zone_record
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think he API docs as a reference would be fine, then.
Ref #29