Class: Saklient::Cloud::Models::Model_Iface

Inherits:
Model
  • Object
show all
Defined in:
lib/saklient/cloud/models/model_iface.rb

Overview

インタフェースを検索・作成するための機能を備えたクラス.

Instance Attribute Summary

Attributes inherited from Model

#client, #count, #query, #total

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Model_Iface

Returns a new instance of Model_Iface.

Parameters:



118
119
120
121
# File 'lib/saklient/cloud/models/model_iface.rb', line 118

def initialize(client)
  super(client)
  Saklient::Util::validate_type(client, 'Saklient::Cloud::Client')
end

Instance Method Details

#createSaklient::Cloud::Resources::Iface

新規リソース作成用のオブジェクトを用意します.

返り値のオブジェクトにパラメータを設定し, save() を呼ぶことで実際のリソースが作成されます.

Returns:



96
97
98
# File 'lib/saklient/cloud/models/model_iface.rb', line 96

def create
  return _create
end

#filter_by(key, value, multiple = false) ⇒ Model_Iface

Web APIのフィルタリング設定を直接指定します.

Parameters:

  • key (String)

    キー

  • value (any)

  • multiple (bool) (defaults to: false)

    valueに配列を与え, OR条件で完全一致検索する場合にtrueを指定します. 通常, valueはスカラ値であいまい検索されます.

Returns:



78
79
80
81
82
# File 'lib/saklient/cloud/models/model_iface.rb', line 78

def filter_by(key, value, multiple = false)
  Saklient::Util::validate_type(key, 'String')
  Saklient::Util::validate_type(multiple, 'bool')
  return _filter_by(key, value, multiple)
end

#findArray<Saklient::Cloud::Resources::Iface>

リソースの検索リクエストを実行し, 結果をリストで取得します.

Returns:



112
113
114
# File 'lib/saklient/cloud/models/model_iface.rb', line 112

def find
  return _find
end

#get_by_id(id) ⇒ Saklient::Cloud::Resources::Iface

指定したIDを持つ唯一のリソースを取得します.

Parameters:

  • id (String)

Returns:



104
105
106
107
# File 'lib/saklient/cloud/models/model_iface.rb', line 104

def get_by_id(id)
  Saklient::Util::validate_type(id, 'String')
  return _get_by_id(id)
end

#limit(count) ⇒ Model_Iface

次に取得するリストの上限レコード数を指定します.

Parameters:

  • count (Fixnum)

    上限レコード数

Returns:



67
68
69
70
# File 'lib/saklient/cloud/models/model_iface.rb', line 67

def limit(count)
  Saklient::Util::validate_type(count, 'Fixnum')
  return _limit(count)
end

#offset(offset) ⇒ Model_Iface

次に取得するリストの開始オフセットを指定します.

Parameters:

  • offset (Fixnum)

    オフセット

Returns:



58
59
60
61
# File 'lib/saklient/cloud/models/model_iface.rb', line 58

def offset(offset)
  Saklient::Util::validate_type(offset, 'Fixnum')
  return _offset(offset)
end

#resetModel_Iface

次のリクエストのために設定されているステートをすべて破棄します.

Returns:



87
88
89
# File 'lib/saklient/cloud/models/model_iface.rb', line 87

def reset
  return _reset
end