Module: Lieu::Client::Actions

Included in:
Lieu::Client
Defined in:
lib/lieu/client/actions.rb

Overview

Methods for the Place Actions API

Instance Method Summary collapse

Instance Method Details

#add(options = {}) ⇒ Hashie::Mash

Add a place.

Examples:

Lieu.add(
  reference: 'place_reference',
  location: {
    lat: '0.00',
    lng: '0.00'
  },
  name: 'Fuubar',
  types: [
    'shoe_store'
  ],
  language: 'fr'
)

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :location (Hash)

    the location of place

    • :lat (String) the place latitude
    • :lng (String) the place longitude
  • :accuracy (String)

    the accuracy of location

  • :name (String)

    the place name

  • :types (Array)

    the place types

  • :language (String)

    the place name language

Returns:

  • (Hashie::Mash)

    the created place details

See Also:



31
32
33
# File 'lib/lieu/client/actions.rb', line 31

def add(options={})
  post('add', options)
end

#add_event(options = {}) ⇒ Hashie::Mash

Add an event to a place.

Examples:

Lieu.add_event(
  reference: 'place_reference',
  duration: '15',
  language: 'fr',
  summary: 'Nice event',
  url: 'http://fuubar.com/events/fuubar/'
)

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :reference (String)

    the place reference

  • :duration (String)

    the event duration

  • :language (String)

    the event language

  • :summary (String)

    the event summary

  • :url (String)

    the event url

Returns:

  • (Hashie::Mash)

    the created event details

See Also:



77
78
79
# File 'lib/lieu/client/actions.rb', line 77

def add_event(options={})
  post('event/add', options)
end

#bump(options = {}) ⇒ Boolean

Bump a place or an event.

Examples:

Bump a place

Lieu.bump(reference: 'place_reference')

Bump an event

Lieu.bump(reference: 'place_reference', event_id: 'event_id')

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :reference (String)

    the place reference

  • :event_id (String)

    the event id

Returns:

  • (Boolean)

    true if bump was successful, false otherwise

See Also:



56
57
58
# File 'lib/lieu/client/actions.rb', line 56

def bump(options={})
  boolean_from_response(:post, 'bump', options)
end

#delete(options = {}) ⇒ Boolean

Delete a place.

Examples:

Lieu.delete(reference: 'place_reference')

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :reference (String)

    the place reference

Returns:

  • (Boolean)

    true if removal was successful, false otherwise

See Also:



42
43
44
# File 'lib/lieu/client/actions.rb', line 42

def delete(options={})
  boolean_from_response(:post, 'delete', options)
end

#delete_event(options = {}) ⇒ Boolean

Delete an event from a place.

Examples:

Lieu.delete_event(reference: 'place_reference', event_id: 'event_id')

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :reference (String)

    the place reference

  • :event_id (String)

    the event id

Returns:

  • (Boolean)

    true if deletion was successful, false otherwise

See Also:



89
90
91
# File 'lib/lieu/client/actions.rb', line 89

def delete_event(options={})
  boolean_from_response(:post, 'event/delete', options)
end

#event_details(reference, event_id, options = {}) ⇒ Hashie::Mash

Get an event details.

Parameters:

  • reference (String)

    the event place reference

  • event_id (String)

    the event id

  • options (Hash) (defaults to: {})

    optionnal parameters

Returns:

  • (Hashie::Mash)

    the event details



98
99
100
101
102
# File 'lib/lieu/client/actions.rb', line 98

def event_details(reference, event_id, options={})
  options.merge!(reference: reference, event_id: event_id)

  get('event/details', options).result
end