Module: CoingeckoRuby::Client::Events

Included in:
CoingeckoRuby::Client
Defined in:
lib/coingecko_ruby/client/events.rb

Instance Method Summary collapse

Instance Method Details

#event_countriesHash

Fetches the valid list of countries to fetch events from.

Examples:

Get all event countries.

client.event_countries

Sample response object (truncated)

{
  "data" => [{
      "country" => nil,
      "code" => ""
    },
    {
      "country" => "Malaysia",
      "code" => "MY"
    },
    {
      "country" => "Singapore",
      "code" => "SG"
    },
    {
      "country" => "United States",
      "code" => "US"
    }
  ],
  "count" => 4
}

Returns:

  • (Hash)

    each country’s name and code and the total country count.



54
55
56
# File 'lib/coingecko_ruby/client/events.rb', line 54

def event_countries
  get 'events/countries'
end

#event_typesArray<Hash>

Fetches the valid list of events to fetch.

Examples:

Get all event types.

client.event_types

Sample response object

{
  "data" => ["Event", "Conference", "Meetup"],
  "count" => 3
}

Returns:

  • (Array<Hash>)

    the list of event types and total event types count.



74
75
76
# File 'lib/coingecko_ruby/client/events.rb', line 74

def event_types
  get 'events/types'
end

#events(**options) ⇒ Array<Hash>

TODO:

CoinGecko API is not returning any list of events. Investigate why this is happening.

Fetches the list of events listed in CoinGecko.

Examples:

Get all upcoming events.

client.events(upcoming_events_only: true) 

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (**options):

  • :country_code (String)

    country code to fetch list of events from.

  • :type (String)

    type of event to fetch.

  • :page (Integer)

    sets the page for results.

  • :upcoming_events_only (Boolean) — default: true

    determines whether to fetch upcoming events only or all events.

  • :from_date (String)

    fetch events after the specified date. Date must be in the format of yyyy-mm-dd

  • :to_date (String)

    fetch events before the specified date. Date must be in the format of yyyy-mm-dd

Returns:

  • (Array<Hash>)

    each finance platform’s name, category, url, facts (description), and centralized status.



18
19
20
# File 'lib/coingecko_ruby/client/events.rb', line 18

def events(**options)
  get 'events', **options
end

#get_event_countriesObject

Deprecated.

Use #event_countries instead



59
60
61
# File 'lib/coingecko_ruby/client/events.rb', line 59

def get_event_countries
  event_countries
end

#get_event_typesObject

Deprecated.

Use #event_types instead



79
80
81
# File 'lib/coingecko_ruby/client/events.rb', line 79

def get_event_types
  event_types
end

#get_events(options: {}) ⇒ Object

Deprecated.

Use #events instead



23
24
25
# File 'lib/coingecko_ruby/client/events.rb', line 23

def get_events(options: {})
  events(**options)
end