class Twimock::AccessToken
Constants
- COLUMN_NAMES
- TABLE_NAME
Public Class Methods
new(options={})
click to toggle source
# File lib/twimock/access_token.rb, line 9 def initialize(options={}) opts = Hashie::Mash.new(options) id = opts.id.to_i @id = id if id > 0 app_id = opts.application_id.to_i @application_id = app_id if app_id > 0 user_id = opts.user_id.to_i @user_id = user_id if user_id > 0 @string = generate_string(opts.string) @secret = opts.secret || Faker::Lorem.characters(45) @created_at = opts.created_at end
Private Instance Methods
generate_string(string=nil)
click to toggle source
# File lib/twimock/access_token.rb, line 25 def generate_string(string=nil) return string if string return "#{@user_id}-#{Faker::Lorem.characters(39)}" if @user_id return Faker::Lorem.characters(50) end