Class: Flumtter::Account

Inherits:
Object
  • Object
show all
Defined in:
lib/flumtter/app/core/account_selector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Account

Returns a new instance of Account.

Raises:

  • (ArgumentError)


9
10
11
12
13
14
15
16
# File 'lib/flumtter/app/core/account_selector.rb', line 9

def initialize(options)
  raise ArgumentError, "Argument is not hash" unless options.is_a?(Hash)
  keys = %i(consumer_key consumer_secret access_token access_token_secret)
  options.requires(*%i(screen_name)+keys)
  @screen_name = options[:screen_name]
  @id = options[:id]
  @keys = Hash[keys.zip options.values_at(*keys)]
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/flumtter/app/core/account_selector.rb', line 8

def id
  @id
end

#keysObject (readonly)

Returns the value of attribute keys.



8
9
10
# File 'lib/flumtter/app/core/account_selector.rb', line 8

def keys
  @keys
end

#screen_nameObject (readonly)

Returns the value of attribute screen_name.



8
9
10
# File 'lib/flumtter/app/core/account_selector.rb', line 8

def screen_name
  @screen_name
end