[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# signet - Class Signet::OAuth1::Credential (v0.21.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.21.0 (latest)](/ruby/docs/reference/signet/latest/Signet-OAuth1-Credential)\n- [0.20.0](/ruby/docs/reference/signet/0.20.0/Signet-OAuth1-Credential) \nReference documentation and code samples for the signet class Signet::OAuth1::Credential. \n\nInherits\n--------\n\n- Object\n\nMethods\n-------\n\n### #==\n\n def ==(other)\n\n### #initialize\n\n def initialize(*args) -\u003e Credential\n\nCreates a token object from a key and secret. \n**Returns**\n\n- ([Credential](./Signet-OAuth1-Credential)) --- a new instance of Credential \n**Raises**\n\n- (TypeError)\n**Examples** \n\n```ruby\nSignet::OAuth1::Credential.new(\n :key =\u003e \"dpf43f3p2l4k3l03\",\n :secret =\u003e \"kd94hf93k423kf44\"\n)\n``` \n\n```ruby\nSignet::OAuth1::Credential.new([\n [\"oauth_token\", \"dpf43f3p2l4k3l03\"],\n [\"oauth_token_secret\", \"kd94hf93k423kf44\"]\n])\n``` \n\n```ruby\nSignet::OAuth1::Credential.new(\n \"dpf43f3p2l4k3l03\", \"kd94hf93k423kf44\"\n)\n```\n\n### #key\n\n def key()\n\nReturns the value of attribute key.\n\n### #key=\n\n def key=(value)\n\nSets the attribute key\n\n### #secret\n\n def secret()\n\nReturns the value of attribute secret.\n\n### #secret=\n\n def secret=(value)\n\nSets the attribute secret\n\n### #to_h\n\n def to_h()\n\n**Alias Of** : [#to_hash](./Signet-OAuth1-Credential#Signet__OAuth1__Credential_to_hash_instance_)\n\n### #to_hash\n\n def to_hash()\n\n**Aliases**\n\n- [#to_h](./Signet-OAuth1-Credential#Signet__OAuth1__Credential_to_h_instance_)"]]