Module: FmRest::V1::Paths

Included in:
FmRest::V1
Defined in:
lib/fmrest/v1/paths.rb

Instance Method Summary collapse

Instance Method Details

#container_field_path(layout, id, field_name, field_repetition = 1) ⇒ Object



20
21
22
23
24
25
# File 'lib/fmrest/v1/paths.rb', line 20

def container_field_path(layout, id, field_name, field_repetition = 1)
  url = record_path(layout, id)
  url += "/containers/#{URI.escape(field_name.to_s)}"
  url += "/#{field_repetition}" if field_repetition
  url
end

#find_path(layout) ⇒ Object



27
28
29
# File 'lib/fmrest/v1/paths.rb', line 27

def find_path(layout)
  "layouts/#{URI.escape(layout.to_s)}/_find"
end

#globals_pathObject



31
32
33
# File 'lib/fmrest/v1/paths.rb', line 31

def globals_path
  "globals"
end

#record_path(layout, id = nil) ⇒ Object



14
15
16
17
18
# File 'lib/fmrest/v1/paths.rb', line 14

def record_path(layout, id = nil)
  url = "layouts/#{URI.escape(layout.to_s)}/records"
  url += "/#{id}" if id
  url
end

#session_path(token = nil) ⇒ Object



8
9
10
11
12
# File 'lib/fmrest/v1/paths.rb', line 8

def session_path(token = nil)
  url = "sessions"
  url += "/#{token}" if token
  url
end