Class: Backstage::DashboardConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/backstage/dashboard_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ DashboardConfig

Returns a new instance of DashboardConfig.



5
6
7
8
9
# File 'lib/backstage/dashboard_config.rb', line 5

def initialize(hash)
  @name = hash["name"]
  @model_name = hash["model"]
  @scope = hash["scope"] || {}
end

Instance Attribute Details

#model_nameObject (readonly)

Returns the value of attribute model_name.



3
4
5
# File 'lib/backstage/dashboard_config.rb', line 3

def model_name
  @model_name
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/backstage/dashboard_config.rb', line 3

def name
  @name
end

#scopeObject (readonly)

Returns the value of attribute scope.



3
4
5
# File 'lib/backstage/dashboard_config.rb', line 3

def scope
  @scope
end

Instance Method Details

#resource_configObject



11
12
13
# File 'lib/backstage/dashboard_config.rb', line 11

def resource_config
  Backstage.registry.resource_for(model_name)
end