Class: Girdle::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/girdle/controller.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Controller

Returns a new instance of Controller.



7
8
9
# File 'lib/girdle/controller.rb', line 7

def initialize(id)
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/girdle/controller.rb', line 5

def id
  @id
end

Class Method Details

.autopromote(role) ⇒ Object



25
26
27
28
29
# File 'lib/girdle/controller.rb', line 25

def self.autopromote(role)
  Girdle.run(
    controller: 'autopromote', role: role.to_s.upcase
  )['controllerRole']
end

.listObject



11
12
13
# File 'lib/girdle/controller.rb', line 11

def self.list
  Girdle.run(controller: 'list')['controllerList']
end

.promote(role) ⇒ Object



19
20
21
22
23
# File 'lib/girdle/controller.rb', line 19

def self.promote(role)
  Girdle.run(
    controller: 'promote', role: role.to_s.upcase
  )['controllerRole']
end

.roleObject



15
16
17
# File 'lib/girdle/controller.rb', line 15

def self.role
  Girdle.run(controller: 'role')['controllerRole']
end