Class: SDM::RequestableResource

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

Overview

RequestableResource is a resource that can be requested via an AccessRequestConfig

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access: nil, authentication: nil, healthy: nil, id: nil, name: nil, tags: nil, type: nil) ⇒ RequestableResource

Returns a new instance of RequestableResource.



9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
# File 'lib/models/porcelain.rb', line 9148

def initialize(
  access: nil,
  authentication: nil,
  healthy: nil,
  id: nil,
  name: nil,
  tags: nil,
  type: nil
)
  @access = access == nil ? "" : access
  @authentication = authentication == nil ? "" : authentication
  @healthy = healthy == nil ? false : healthy
  @id = id == nil ? "" : id
  @name = name == nil ? "" : name
  @tags = tags == nil ? SDM::_porcelain_zero_value_tags() : tags
  @type = type == nil ? "" : type
end

Instance Attribute Details

#accessObject

The current state of the user's access to the resources



9134
9135
9136
# File 'lib/models/porcelain.rb', line 9134

def access
  @access
end

#authenticationObject

The type of authentication for the resource



9136
9137
9138
# File 'lib/models/porcelain.rb', line 9136

def authentication
  @authentication
end

#healthyObject

The health check status of the reasource



9138
9139
9140
# File 'lib/models/porcelain.rb', line 9138

def healthy
  @healthy
end

#idObject

The resource id.



9140
9141
9142
# File 'lib/models/porcelain.rb', line 9140

def id
  @id
end

#nameObject

The resource name.



9142
9143
9144
# File 'lib/models/porcelain.rb', line 9142

def name
  @name
end

#tagsObject

Any tags attached to this resource



9144
9145
9146
# File 'lib/models/porcelain.rb', line 9144

def tags
  @tags
end

#typeObject

The resource type



9146
9147
9148
# File 'lib/models/porcelain.rb', line 9146

def type
  @type
end

Instance Method Details

#to_json(options = {}) ⇒ Object



9166
9167
9168
9169
9170
9171
9172
# File 'lib/models/porcelain.rb', line 9166

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