Class: Strutta::Flow

Inherits:
APIObject show all
Defined in:
lib/strutta-api/flow.rb

Overview

Flow belongs to a Strutta::Games object Other Instance methods found in Strutta::APIObject

Instance Attribute Summary

Attributes inherited from APIObject

#game

Instance Method Summary collapse

Methods inherited from APIObject

#create, #method_disabled

Constructor Details

#initialize(id = nil, game) ⇒ Strutta::Flow

Initializes the Strutta::Flow object

Parameters:


9
10
11
12
13
# File 'lib/strutta-api/flow.rb', line 9

def initialize(id = nil, game)
  @id = id
  @game = game
  @root_path = 'flow'
end

Instance Method Details

#deleteHash

DELETE request for Flow (no ID required)

Returns:

  • (Hash)

    Parsed body of the API response


26
27
28
29
# File 'lib/strutta-api/flow.rb', line 26

def delete
  @game.verify_no_id(@id)
  @game.delete(@root_path)
end

#getHash

GET request for Flow (no ID required)

Returns:

  • (Hash)

    Parsed body of the API response


18
19
20
21
# File 'lib/strutta-api/flow.rb', line 18

def get
  @game.verify_no_id(@id)
  @game.get({}, @root_path)
end