Module: DroneApi

Defined in:
lib/drone_api.rb,
lib/drone_api/version.rb

Defined Under Namespace

Modules: Accounts, Buildings, Clients, Inspections Classes: Auth, AuthError, Base, Configuration, ConfigurationError, Error

Constant Summary collapse

VERSION =
"0.1.7"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



22
23
24
# File 'lib/drone_api.rb', line 22

def configuration
  @configuration
end

Class Method Details

.configure(&blk) ⇒ Object



24
25
26
# File 'lib/drone_api.rb', line 24

def configure &blk
  self.configuration ||= DroneApi::Configuration.new.tap(&blk)
end

.generate_token(payload = { username: DroneApi.configuration&.client_id }) ⇒ Object



28
29
30
# File 'lib/drone_api.rb', line 28

def generate_token payload={ username: DroneApi.configuration&.client_id }
  DroneApi::Auth.new(payload).response
end