Class: LoopsSdk::Components

Inherits:
Base
  • Object
show all
Defined in:
lib/loops_sdk/components.rb

Class Method Summary collapse

Class Method Details

.create(name:, lmx:) ⇒ Object



14
15
16
# File 'lib/loops_sdk/components.rb', line 14

def create(name:, lmx:)
  make_request(method: :post, path: "v1/components", body: { name: name, lmx: lmx })
end

.get(component_id:) ⇒ Object



10
11
12
# File 'lib/loops_sdk/components.rb', line 10

def get(component_id:)
  make_request(method: :get, path: "v1/components/#{component_id}")
end

.list(perPage: 20, cursor: nil) ⇒ Object



6
7
8
# File 'lib/loops_sdk/components.rb', line 6

def list(perPage: 20, cursor: nil)
  make_request(method: :get, path: "v1/components", params: { perPage: perPage, cursor: cursor })
end

.update(component_id:, name: nil, lmx: nil) ⇒ Object



18
19
20
21
# File 'lib/loops_sdk/components.rb', line 18

def update(component_id:, name: nil, lmx: nil)
  body = { name: name, lmx: lmx }.compact
  make_request(method: :post, path: "v1/components/#{component_id}", body: body)
end