Module: Inthegra::Client::Lines

Included in:
Inthegra::Client
Defined in:
lib/inthegra/client/lines.rb

Overview

Define methods related to lines

Instance Method Summary collapse

Instance Method Details

#line_search(query) ⇒ Array::Line

Return a list of all searched lines

Examples:

Return a list of all lines localized in ‘ininga’ neighborhood

Inthegra.line_search('ininga')

Parameters:

  • query (String)

    An search query

Returns:

  • (Array::Line)

    All lines

See Also:



27
28
29
30
31
# File 'lib/inthegra/client/lines.rb', line 27

def line_search(query)
  response = get('linhas', { busca: URI::encode(query) })

  CollectionSerializer.parse(response, Line)
end

#linesArray::Line

Return a list of all lines

Examples:

Return all lines

Inthegra.lines

Returns:

  • (Array::Line)

    All lines

See Also:



13
14
15
16
17
# File 'lib/inthegra/client/lines.rb', line 13

def lines
  response = get('linhas')

  CollectionSerializer.parse(response, Line)
end