Class: Manifestly::Entity::ChecklistStep
- Defined in:
- lib/manifestly/entity/checklist_step.rb
Instance Attribute Summary collapse
-
#assignee_avatar_url ⇒ Object
Returns the value of attribute assignee_avatar_url.
-
#assignee_id ⇒ Object
Returns the value of attribute assignee_id.
-
#assignee_name ⇒ Object
Returns the value of attribute assignee_name.
-
#assignee_simple_display_name ⇒ Object
Returns the value of attribute assignee_simple_display_name.
-
#assignee_user_id ⇒ Object
Returns the value of attribute assignee_user_id.
-
#comments ⇒ Object
Returns the value of attribute comments.
-
#completed_at ⇒ Object
Returns the value of attribute completed_at.
-
#data ⇒ Object
Returns the value of attribute data.
-
#description_with_links ⇒ Object
Returns the value of attribute description_with_links.
-
#header_step ⇒ Object
Header step needs to always be a boolean (even if not set).
-
#id ⇒ Object
Returns the value of attribute id.
-
#late_at ⇒ Object
Returns the value of attribute late_at.
-
#picture ⇒ Object
Returns the value of attribute picture.
-
#position ⇒ Object
Returns the value of attribute position.
-
#run_detailed_title ⇒ Object
Returns the value of attribute run_detailed_title.
-
#run_id ⇒ Object
Returns the value of attribute run_id.
-
#run_step_data_setting ⇒ Object
Returns the value of attribute run_step_data_setting.
-
#skipped ⇒ Object
Returns the value of attribute skipped.
-
#title ⇒ Object
Returns the value of attribute title.
-
#user ⇒ Object
Returns the value of attribute user.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Class Method Summary collapse
Instance Method Summary collapse
- #add_comment(comment) ⇒ Object
- #add_data(data) ⇒ Object
- #add_picture(base_64_encoded_picture_data) ⇒ Object
- #assign(user_id) ⇒ Object
- #complete ⇒ Object
-
#initialize(run, data = {}) ⇒ ChecklistStep
constructor
A new instance of ChecklistStep.
- #skip ⇒ Object
- #uncomplete ⇒ Object
- #unskip ⇒ Object
Methods inherited from Endpoint
client, #client, #create, #delete, get, #path, #save, #update
Methods inherited from Base
attr_accessor, attr_reader, attributes, #attributes, #attributes=, invalid_class_method, invalid_method, #to_h
Constructor Details
#initialize(run, data = {}) ⇒ ChecklistStep
Returns a new instance of ChecklistStep.
35 36 37 38 39 40 |
# File 'lib/manifestly/entity/checklist_step.rb', line 35 def initialize(run, data = {}) raise 'invalid checklist run' unless run.is_a?(ChecklistRun) @parent = run super(data) end |
Instance Attribute Details
#assignee_avatar_url ⇒ Object
Returns the value of attribute assignee_avatar_url.
8 9 10 |
# File 'lib/manifestly/entity/checklist_step.rb', line 8 def assignee_avatar_url @assignee_avatar_url end |
#assignee_id ⇒ Object
Returns the value of attribute assignee_id.
9 10 11 |
# File 'lib/manifestly/entity/checklist_step.rb', line 9 def assignee_id @assignee_id end |
#assignee_name ⇒ Object
Returns the value of attribute assignee_name.
10 11 12 |
# File 'lib/manifestly/entity/checklist_step.rb', line 10 def assignee_name @assignee_name end |
#assignee_simple_display_name ⇒ Object
Returns the value of attribute assignee_simple_display_name.
12 13 14 |
# File 'lib/manifestly/entity/checklist_step.rb', line 12 def assignee_simple_display_name @assignee_simple_display_name end |
#assignee_user_id ⇒ Object
Returns the value of attribute assignee_user_id.
11 12 13 |
# File 'lib/manifestly/entity/checklist_step.rb', line 11 def assignee_user_id @assignee_user_id end |
#comments ⇒ Object
Returns the value of attribute comments.
14 15 16 |
# File 'lib/manifestly/entity/checklist_step.rb', line 14 def comments @comments end |
#completed_at ⇒ Object
Returns the value of attribute completed_at.
13 14 15 |
# File 'lib/manifestly/entity/checklist_step.rb', line 13 def completed_at @completed_at end |
#data ⇒ Object
Returns the value of attribute data.
15 16 17 |
# File 'lib/manifestly/entity/checklist_step.rb', line 15 def data @data end |
#description_with_links ⇒ Object
Returns the value of attribute description_with_links.
16 17 18 |
# File 'lib/manifestly/entity/checklist_step.rb', line 16 def description_with_links @description_with_links end |
#header_step ⇒ Object
Header step needs to always be a boolean (even if not set)
43 44 45 |
# File 'lib/manifestly/entity/checklist_step.rb', line 43 def header_step @header_step end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/manifestly/entity/checklist_step.rb', line 7 def id @id end |
#late_at ⇒ Object
Returns the value of attribute late_at.
19 20 21 |
# File 'lib/manifestly/entity/checklist_step.rb', line 19 def late_at @late_at end |
#picture ⇒ Object
Returns the value of attribute picture.
26 27 28 |
# File 'lib/manifestly/entity/checklist_step.rb', line 26 def picture @picture end |
#position ⇒ Object
Returns the value of attribute position.
20 21 22 |
# File 'lib/manifestly/entity/checklist_step.rb', line 20 def position @position end |
#run_detailed_title ⇒ Object
Returns the value of attribute run_detailed_title.
17 18 19 |
# File 'lib/manifestly/entity/checklist_step.rb', line 17 def run_detailed_title @run_detailed_title end |
#run_id ⇒ Object
Returns the value of attribute run_id.
21 22 23 |
# File 'lib/manifestly/entity/checklist_step.rb', line 21 def run_id @run_id end |
#run_step_data_setting ⇒ Object
Returns the value of attribute run_step_data_setting.
27 28 29 |
# File 'lib/manifestly/entity/checklist_step.rb', line 27 def run_step_data_setting @run_step_data_setting end |
#skipped ⇒ Object
Returns the value of attribute skipped.
22 23 24 |
# File 'lib/manifestly/entity/checklist_step.rb', line 22 def skipped @skipped end |
#title ⇒ Object
Returns the value of attribute title.
23 24 25 |
# File 'lib/manifestly/entity/checklist_step.rb', line 23 def title @title end |
#user ⇒ Object
Returns the value of attribute user.
25 26 27 |
# File 'lib/manifestly/entity/checklist_step.rb', line 25 def user @user end |
#user_id ⇒ Object
Returns the value of attribute user_id.
24 25 26 |
# File 'lib/manifestly/entity/checklist_step.rb', line 24 def user_id @user_id end |
Class Method Details
.list(run) ⇒ Object
56 57 58 59 60 |
# File 'lib/manifestly/entity/checklist_step.rb', line 56 def self.list(run) response = client.get("#{run.path}/#{run.id}/#{path}") json_entities = JSON.parse(response[:body], symbolize_names: true)[path.to_sym] json_entities.map { |it| new(run, it) } end |
.path ⇒ Object
52 53 54 |
# File 'lib/manifestly/entity/checklist_step.rb', line 52 def self.path 'run_steps' end |
Instance Method Details
#add_comment(comment) ⇒ Object
98 99 100 101 102 |
# File 'lib/manifestly/entity/checklist_step.rb', line 98 def add_comment(comment) client.post("#{@parent.path}/#{@parent.id}/#{path}/#{id}/comments", params: {comment: comment}) @parent.instance_variable_set(:@steps, nil) nil end |
#add_data(data) ⇒ Object
86 87 88 89 90 |
# File 'lib/manifestly/entity/checklist_step.rb', line 86 def add_data(data) client.post("#{@parent.path}/#{@parent.id}/#{path}/#{id}/data", params: {data: data}) @parent.instance_variable_set(:@steps, nil) nil end |
#add_picture(base_64_encoded_picture_data) ⇒ Object
92 93 94 95 96 |
# File 'lib/manifestly/entity/checklist_step.rb', line 92 def add_picture(base_64_encoded_picture_data) client.post("#{@parent.path}/#{@parent.id}/#{path}/#{id}/picture", params: {picture: base_64_encoded_picture_data}) @parent.instance_variable_set(:@steps, nil) nil end |
#assign(user_id) ⇒ Object
104 105 106 107 108 |
# File 'lib/manifestly/entity/checklist_step.rb', line 104 def assign(user_id) client.post("#{@parent.path}/#{@parent.id}/#{path}/#{id}/assign", params: {assignee_user_id: user_id}) @parent.instance_variable_set(:@steps, nil) nil end |
#complete ⇒ Object
62 63 64 65 66 |
# File 'lib/manifestly/entity/checklist_step.rb', line 62 def complete client.post("#{@parent.path}/#{@parent.id}/#{path}/#{id}/complete") @parent.instance_variable_set(:@steps, nil) nil end |
#skip ⇒ Object
74 75 76 77 78 |
# File 'lib/manifestly/entity/checklist_step.rb', line 74 def skip client.post("#{@parent.path}/#{@parent.id}/#{path}/#{id}/skip") @parent.instance_variable_set(:@steps, nil) nil end |
#uncomplete ⇒ Object
68 69 70 71 72 |
# File 'lib/manifestly/entity/checklist_step.rb', line 68 def uncomplete client.post("#{@parent.path}/#{@parent.id}/#{path}/#{id}/uncomplete") @parent.instance_variable_set(:@steps, nil) nil end |
#unskip ⇒ Object
80 81 82 83 84 |
# File 'lib/manifestly/entity/checklist_step.rb', line 80 def unskip client.post("#{@parent.path}/#{@parent.id}/#{path}/#{id}/unskip") @parent.instance_variable_set(:@steps, nil) nil end |