Module: Shutterstock::Configurable

Included in:
Shutterstock, API::Auth, API::Util, Client
Defined in:
lib/shutterstock/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_key=(value) ⇒ Object (writeonly)

Sets the attribute api_key

Parameters:

  • value

    the value to set the attribute api_key to.



3
4
5
# File 'lib/shutterstock/configurable.rb', line 3

def api_key=(value)
  @api_key = value
end

#api_username=(value) ⇒ Object (writeonly)

Sets the attribute api_username

Parameters:

  • value

    the value to set the attribute api_username to.



3
4
5
# File 'lib/shutterstock/configurable.rb', line 3

def api_username=(value)
  @api_username = value
end

#email=(value) ⇒ Object (writeonly)

Sets the attribute email

Parameters:

  • value

    the value to set the attribute email to.



3
4
5
# File 'lib/shutterstock/configurable.rb', line 3

def email=(value)
  @email = value
end

#password=(value) ⇒ Object (writeonly)

Sets the attribute password

Parameters:

  • value

    the value to set the attribute password to.



3
4
5
# File 'lib/shutterstock/configurable.rb', line 3

def password=(value)
  @password = value
end

#username=(value) ⇒ Object (writeonly)

Sets the attribute username

Parameters:

  • value

    the value to set the attribute username to.



3
4
5
# File 'lib/shutterstock/configurable.rb', line 3

def username=(value)
  @username = value
end

Class Method Details

.keysObject



6
7
8
9
10
11
12
13
14
# File 'lib/shutterstock/configurable.rb', line 6

def keys
  @keys ||= [
    :api_username,
    :api_key,
    :username,
    :password,
    :email
  ]
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



17
18
19
20
# File 'lib/shutterstock/configurable.rb', line 17

def configure
  yield self
  self
end

#credentialsObject



22
23
24
25
26
27
28
29
30
# File 'lib/shutterstock/configurable.rb', line 22

def credentials
  {
    api_username: @api_username,
    api_key: @api_key,
    username: @username,
    password: @password,
    email: @email
  }
end