Class: SDM::HTTPAuth

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, name: nil, healthy: nil, url: nil, healthcheck_path: nil, auth_header: nil, headers_blacklist: nil, default_path: nil, subdomain: nil) ⇒ HTTPAuth

Returns a new instance of HTTPAuth.



1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
# File 'lib/models/porcelain.rb', line 1246

def initialize(
  id: nil,
  name: nil,
  healthy: nil,
  url: nil,
  healthcheck_path: nil,
  auth_header: nil,
  headers_blacklist: nil,
  default_path: nil,
  subdomain: nil
)
  if id != nil
    @id = id
  end
  if name != nil
    @name = name
  end
  if healthy != nil
    @healthy = healthy
  end
  if url != nil
    @url = url
  end
  if healthcheck_path != nil
    @healthcheck_path = healthcheck_path
  end
  if auth_header != nil
    @auth_header = auth_header
  end
  if headers_blacklist != nil
    @headers_blacklist = headers_blacklist
  end
  if default_path != nil
    @default_path = default_path
  end
  if subdomain != nil
    @subdomain = subdomain
  end
end

Instance Attribute Details

#auth_headerObject

Returns the value of attribute auth_header.



1238
1239
1240
# File 'lib/models/porcelain.rb', line 1238

def auth_header
  @auth_header
end

#default_pathObject

Returns the value of attribute default_path.



1242
1243
1244
# File 'lib/models/porcelain.rb', line 1242

def default_path
  @default_path
end

#headers_blacklistObject

Returns the value of attribute headers_blacklist.



1240
1241
1242
# File 'lib/models/porcelain.rb', line 1240

def headers_blacklist
  @headers_blacklist
end

#healthcheck_pathObject

Returns the value of attribute healthcheck_path.



1236
1237
1238
# File 'lib/models/porcelain.rb', line 1236

def healthcheck_path
  @healthcheck_path
end

#healthyObject

True if the datasource is reachable and the credentials are valid.



1232
1233
1234
# File 'lib/models/porcelain.rb', line 1232

def healthy
  @healthy
end

#idObject

Unique identifier of the Resource.



1228
1229
1230
# File 'lib/models/porcelain.rb', line 1228

def id
  @id
end

#nameObject

Unique human-readable name of the Resource.



1230
1231
1232
# File 'lib/models/porcelain.rb', line 1230

def name
  @name
end

#subdomainObject

Returns the value of attribute subdomain.



1244
1245
1246
# File 'lib/models/porcelain.rb', line 1244

def subdomain
  @subdomain
end

#urlObject

Returns the value of attribute url.



1234
1235
1236
# File 'lib/models/porcelain.rb', line 1234

def url
  @url
end

Instance Method Details

#to_json(options = {}) ⇒ Object



1286
1287
1288
1289
1290
1291
1292
# File 'lib/models/porcelain.rb', line 1286

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end