Class: ActionKitRest::Tag

Inherits:
Base
  • Object
show all
Defined in:
lib/action_kit_rest/tag.rb

Instance Method Summary collapse

Methods inherited from Base

#create, #get, #list, #normalized_base_path, #update

Instance Method Details

#base_pathObject



5
6
7
# File 'lib/action_kit_rest/tag.rb', line 5

def base_path
  'tag'
end

#find(name) ⇒ Object



9
10
11
12
# File 'lib/action_kit_rest/tag.rb', line 9

def find(name)
  response = list(name: name)
  response.obj.first
end

#find_or_create(name) ⇒ Object



14
15
16
17
18
# File 'lib/action_kit_rest/tag.rb', line 14

def find_or_create(name)
  tag = find(name)
  tag = create(name: name) if tag.blank?
  tag
end