Class: WorkItems::Widgets::Base

Inherits:
Object
  • Object
show all
Defined in:
app/models/work_items/widgets/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(work_item) ⇒ Base

Returns a new instance of Base.



36
37
38
# File 'app/models/work_items/widgets/base.rb', line 36

def initialize(work_item)
  @work_item = work_item
end

Instance Attribute Details

#work_itemObject (readonly)

Returns the value of attribute work_item.



40
41
42
# File 'app/models/work_items/widgets/base.rb', line 40

def work_item
  @work_item
end

Class Method Details

.api_symbolObject



10
11
12
# File 'app/models/work_items/widgets/base.rb', line 10

def self.api_symbol
  "#{type}_widget".to_sym
end

.callback_classObject



22
23
24
25
26
27
28
29
30
# File 'app/models/work_items/widgets/base.rb', line 22

def self.callback_class
  WorkItems::Callbacks.const_get(name.demodulize, false)
rescue NameError
  begin
    Issuable::Callbacks.const_get(name.demodulize, false)
  rescue NameError
    nil
  end
end

.process_quick_action_param(param_name, value) ⇒ Object



18
19
20
# File 'app/models/work_items/widgets/base.rb', line 18

def self.process_quick_action_param(param_name, value)
  { param_name => value }
end

.quick_action_commandsObject



14
15
16
# File 'app/models/work_items/widgets/base.rb', line 14

def self.quick_action_commands
  []
end

.typeObject



6
7
8
# File 'app/models/work_items/widgets/base.rb', line 6

def self.type
  name.demodulize.underscore.to_sym
end

Instance Method Details

#typeObject



32
33
34
# File 'app/models/work_items/widgets/base.rb', line 32

def type
  self.class.type
end