Class: Doggy::Models::Screen

Inherits:
Doggy::Model show all
Defined in:
lib/doggy/models/screen.rb

Instance Attribute Summary

Attributes inherited from Doggy::Model

#is_deleted, #loading_source, #path

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Doggy::Model

#==, accepted_response, all_local_resources, changed_resources, current_sha, #destroy, #destroy_local, emit_shipit_deployment, find, find_local, infer_type, #initialize, request, #save, #save_local, sort_by_key, #to_h, #validate

Constructor Details

This class inherits a constructor from Doggy::Model

Class Method Details

.resource_url(id = nil) ⇒ Object



29
30
31
32
33
# File 'lib/doggy/models/screen.rb', line 29

def self.resource_url(id = nil)
  "https://app.datadoghq.com/api/v1/screen".tap do |base_url|
    base_url << "/#{ id }" if id
  end
end

Instance Method Details

#ensure_managed_emoji!Object



39
40
41
42
43
# File 'lib/doggy/models/screen.rb', line 39

def ensure_managed_emoji!
  return unless managed?
  return if self.board_title =~ /\xF0\x9F\x90\xB6/
  self.board_title += " \xF0\x9F\x90\xB6"
end

#ensure_read_only!Object



21
22
23
# File 'lib/doggy/models/screen.rb', line 21

def ensure_read_only!
  self.read_only = true
end

#human_urlObject Also known as: human_edit_url



45
46
47
# File 'lib/doggy/models/screen.rb', line 45

def human_url
  "https://app.datadoghq.com/screen/#{ id }"
end

#managed?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/doggy/models/screen.rb', line 35

def managed?
  !(board_title =~ Doggy::DOG_SKIP_REGEX)
end

#prefixObject



17
18
19
# File 'lib/doggy/models/screen.rb', line 17

def prefix
  'screen'
end

#refute_read_only!Object



25
26
27
# File 'lib/doggy/models/screen.rb', line 25

def refute_read_only!
  self.read_only = false
end