Class: Square::APIResource

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

Class Method Summary collapse

Class Method Details

.data_type(data_type = nil) ⇒ Square::DataType

Set a data_type property for this resource.

Parameters:

Returns:


8
9
10
11
12
13
14
# File 'lib/square/api_resource.rb', line 8

def self.data_type(data_type = nil)
  if !data_type.nil?
    @data_type = data_type
  end

  @data_type
end

.endpoint_base(base = nil) ⇒ String

Set an endpoint base for this resource.

Parameters:

  • base (String) (defaults to: nil)

    API endpoint. Optional.

Returns:

  • (String)

21
22
23
24
25
26
27
# File 'lib/square/api_resource.rb', line 21

def self.endpoint_base(base = nil)
  if !base.nil?
    @endpoint_base = base
  end

  @endpoint_base
end

.nested_under(parent = nil) ⇒ String

Set a property for nested resources.

Parameters:

  • parent (String) (defaults to: nil)

    API 'parent' endpoint. Optional.

Returns:

  • (String)

34
35
36
37
38
39
40
# File 'lib/square/api_resource.rb', line 34

def self.nested_under(parent = nil)
  if !parent.nil?
    @nested_under = parent
  end

  @nested_under
end