Socket
Book a DemoInstallSign in
Socket

gcevent

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gcevent

0.0.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

Build Status Coverage Status

Gcevent

A wrapper of Google Calendar Event API.

Installation

Add this line to your application's Gemfile:

gem 'gcevent'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gcevent

Usage

Calendar Setting

Google::Calendar.id                  = "Id of a target Google Calendar"
Google::Calendar.secret_key.path     = "Path of xxx-privatekey.p12"
Google::Calendar.secret_key.password = "Password"
Google::Calendar.client_secret_path  = "Path of client_secret_xxx.json"
Google::Calendar.client_email        = "Email address of service account"

Event#get

event_id = "Google Calendar Event ID"
event = Google::Calendar::Event.get(event_id)

or

event = Google::Calendar::Event.new(event_id: event_id)
event.fetch

Event#list

specified date or time

start_date = Date.today.beginning_of_week
end_date   = Date.today.end_of_week
events = Google::Calendar::Event.list(start_time, end_time)

today or this week or ...

Google::Calendar::Event.today
Google::Calendar::Event.tomorrow
Google::Calendar::Event.yesterday
Google::Calendar::Event.this_week
Google::Calendar::Event.this_month
Google::Calendar::Event.this_year

Event#insert

event = Google::Calendar::Event.new
event.summary = "Inserted #{Time.now}"
event.start   = { dateTime: Date.today.to_time.utc.iso8601 }
event.end     = { dateTime: Date.tomorrow.to_time.utc.iso8601 }
event.insert

or

options = { summary: "Inserted #{Time.now}",
start:   { date: Date.today },
end:     { date: Date.tomorrow } }
event = Google::Calendar::Event.insert(options)

Event#quickAdd

quick insert

text = "Quick Added"
event = Google::Calendar::Event.quickAdd(text)

Event#update

event = Google::Calendar::Event.this_week.last
event.summary = "Updated #{Time.now}"
event.update

Delete Phase

event = Google::Calendar::Event.this_week.first
event.delete

or

event = Google::Calendar::Event.this_week.last
Google::Calendar::Event.delete(event.id)

Contributing

  • Fork it ( https://github.com/[my-github-username]/gcevent/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

FAQs

Package last updated on 21 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.