Class: Notisend::List

Inherits:
OpenStruct
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/notisend/list.rb

Overview

Class for interaction with lists

Class Method Summary collapse

Class Method Details

.create(title:) ⇒ Object

Creates a new list


16
17
18
19
20
# File 'lib/notisend/list.rb', line 16

def create(title:)
  params = { title: title }
  response = client.post(path, params).parsed_body
  new(response)
end

.get(id:) ⇒ Object

Gets a list by id


23
24
25
26
# File 'lib/notisend/list.rb', line 23

def get(id:)
  response = client.get(path(id)).parsed_body
  new(response)
end

.get_all(params: {}) ⇒ Object

Gets all lists


10
11
12
13
# File 'lib/notisend/list.rb', line 10

def get_all(params: {})
  response = client.get(path, params).parsed_body
  Collection.new(response, self)
end