Class: DoorkeeperJp::Client
- Inherits:
-
Object
- Object
- DoorkeeperJp::Client
- Defined in:
- lib/doorkeeper_jp/client.rb
Instance Method Summary collapse
-
#event(id, is_expand_group: false, locale: nil) ⇒ DoorkeeperJp::Response
Show a specific event.
-
#events(page: nil, locale: nil, sort: nil, since_date: nil, until_date: nil, keyword: nil, prefecture: nil, is_expand_group: false) ⇒ Array<DoorkeeperJp::Response>
List all featured events.
-
#group(group, locale: nil) ⇒ DoorkeeperJp::Response
Show a specific group.
-
#group_events(group, page: nil, locale: nil, sort: nil, since_date: nil, until_date: nil, keyword: nil, prefecture: nil, is_expand_group: false) ⇒ Array<DoorkeeperJp::Response>
List a community’s events.
-
#initialize(access_token = nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(access_token = nil) ⇒ Client
Returns a new instance of Client.
6 7 8 |
# File 'lib/doorkeeper_jp/client.rb', line 6 def initialize(access_token = nil) @access_token = access_token end |
Instance Method Details
#event(id, is_expand_group: false, locale: nil) ⇒ DoorkeeperJp::Response
Show a specific event
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/doorkeeper_jp/client.rb', line 81 def event(id, is_expand_group: false, locale: nil) params = { locale: locale, }.compact params["expand[]"] = "group" if res = connection.get("events/#{id}", params).body res.event end |
#events(page: nil, locale: nil, sort: nil, since_date: nil, until_date: nil, keyword: nil, prefecture: nil, is_expand_group: false) ⇒ Array<DoorkeeperJp::Response>
List all featured events
24 25 26 27 28 29 30 |
# File 'lib/doorkeeper_jp/client.rb', line 24 def events(page: nil, locale: nil, sort: nil, since_date: nil, until_date: nil, keyword: nil, prefecture: nil, is_expand_group: false) get_events( path: "events", page: page, locale: locale, sort: sort, since_date: since_date, until_date: until_date, keyword: keyword, prefecture: prefecture, is_expand_group: , ) end |
#group(group, locale: nil) ⇒ DoorkeeperJp::Response
Show a specific group
63 64 65 66 67 68 69 70 |
# File 'lib/doorkeeper_jp/client.rb', line 63 def group(group, locale: nil) params = { locale: locale, }.compact res = connection.get("groups/#{group}", params).body res.group end |
#group_events(group, page: nil, locale: nil, sort: nil, since_date: nil, until_date: nil, keyword: nil, prefecture: nil, is_expand_group: false) ⇒ Array<DoorkeeperJp::Response>
List a community’s events
47 48 49 50 51 52 53 |
# File 'lib/doorkeeper_jp/client.rb', line 47 def group_events(group, page: nil, locale: nil, sort: nil, since_date: nil, until_date: nil, keyword: nil, prefecture: nil, is_expand_group: false) get_events( path: "groups/#{group}/events", page: page, locale: locale, sort: sort, since_date: since_date, until_date: until_date, keyword: keyword, prefecture: prefecture, is_expand_group: , ) end |