Class: Notisend::Parameter

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

Overview

Class for interaction with list parameters

Class Method Summary collapse

Class Method Details

.create(title:, kind:, list_id:) ⇒ Object

Creates a new parameter for a list


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

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

.get_all(list_id:, params: {}) ⇒ Object

Gets all parameters for a list


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

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