Class: Suzuri::Choice

Inherits:
Object
  • Object
show all
Defined in:
lib/suzuri_client.rb

Overview

“ja”=>“Choiceは、UserがProductを集めて作れるリストです。サイト内ではChoiceのことはオモイデと呼ばれています。”

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Choice

Returns a new instance of Choice



176
177
178
# File 'lib/suzuri_client.rb', line 176

def initialize(client)
  @client = client
end

Instance Method Details

#add_product(choice_id, body) ⇒ Object

product to Choice”, “ja”=>“Choiceに指定したProductを追加します。”

Parameters:

  • choice_id: ("en"=>"unique identifier of Choice", "ja"=>"Choiceのid")
  • body:

    the object to pass as the request payload



205
206
207
# File 'lib/suzuri_client.rb', line 205

def add_product(choice_id, body)
  @client.choice.add_product(choice_id, body)
end

#create(body) ⇒ Object

Choice”, “ja”=>“Choiceを作成します。”

Parameters:

  • body:

    the object to pass as the request payload



190
191
192
# File 'lib/suzuri_client.rb', line 190

def create(body)
  @client.choice.create(body)
end

#delete(choice_id) ⇒ Object

Choice”, “ja”=>“Choiceを削除します。成功すると204を返します。”

Parameters:

  • choice_id: ("en"=>"unique identifier of Choice", "ja"=>"Choiceのid")


197
198
199
# File 'lib/suzuri_client.rb', line 197

def delete(choice_id)
  @client.choice.delete(choice_id)
end

#info(choice_id) ⇒ Object

info for Choice selected by id”, “ja”=>“idで指定したChoiceの情報を取得します。”

Parameters:

  • choice_id: ("en"=>"unique identifier of Choice", "ja"=>"Choiceのid")


183
184
185
# File 'lib/suzuri_client.rb', line 183

def info(choice_id)
  @client.choice.info(choice_id)
end

#list(body) ⇒ Object

list”, “ja”=>“Choiceの一覧を取得します。”

Parameters:

  • body:

    the object to pass as the request payload



228
229
230
# File 'lib/suzuri_client.rb', line 228

def list(body)
  @client.choice.list(body)
end

#remove_product(choice_id, body) ⇒ Object

product from choice”, “ja”=>“Choiceから指定したProductを削除します。”

Parameters:

  • choice_id: ("en"=>"unique identifier of Choice", "ja"=>"Choiceのid")
  • body:

    the object to pass as the request payload



213
214
215
# File 'lib/suzuri_client.rb', line 213

def remove_product(choice_id, body)
  @client.choice.remove_product(choice_id, body)
end

#update(choice_id, body) ⇒ Object

Choice”, “ja”=>“Choiceのタイトルや説明を更新します。”

Parameters:

  • choice_id: ("en"=>"unique identifier of Choice", "ja"=>"Choiceのid")
  • body:

    the object to pass as the request payload



221
222
223
# File 'lib/suzuri_client.rb', line 221

def update(choice_id, body)
  @client.choice.update(choice_id, body)
end