Giter VIP home page Giter VIP logo

LiquidPlanner Ruby Gem

The LiquidPlanner ruby gem provides a simple way to access LiquidPlanner's API. The examples directory demonstrates how to perform some common tasks with this gem.

Documentation

Installation

The LiquidPlanner API client can be installed with Rubygems or Bundler.

Rubygems

gem install liquidplanner

Bundler

Add to your Gemfile and run bundle install

gem 'liquidplanner'

Dependencies

  • activeresource >= 4.0.0
  • activesupport >= 4.0.0
  • multipart-post >= 1.0.1

Usage

Please refer to our API Guide for a full list of endpoints, resources, and attributes. Additional examples are located in this repository's examples directory.

This gem accesses the LiquidPlanner API via ActiveResource. Please read the ActiveResource documentation for additional usage details.

Create a client and connect

lp = LiquidPlanner::Base.new(:email => email, :password => password)
account = lp.account # <LiquidPlanner::Resources::Member>

Workspaces

lp.workspaces    # [<LiquidPlanner::Resources::Workspace>, <LiquidPlanner::Resources::Workspace>]
lp.workspaces(7) # Access workspace by ID

Tasks

workspace = lp.workspaces(7)                                      # Access workspace by ID
tasks     = workspace.tasks                                       # List all tasks
my_tasks  = workspace.tasks(:all, :filter => 'owner_id = me')     # Use a filter
new_task  = workspace.create_task(:name => 'Learn API')           # Create and save a new task

my_tasks.each do |task|                                           # Task details
  puts "Name: #{task.name}"
  
  if task.is_done
    puts "Completed on: #{task.done_on.to_date}"
  else
    puts "Expected finish date: #{task.expected_finish.to_date}"
  end
end

Custom Fields

workspace = lp.workspaces(7)                            # Access workspace by ID

# List custom fields
#
custom_fields = workspace.custom_fields(:all)           # List all custom fields for workspace
custom_fields.each do |custom_field|
  puts "Category: #{custom_field.category}"             # Custom field attributes
  puts "Name:     #{custom_field.name}"
  
  custom_field.values.each do |custom_field_value|      # Custom field values
    puts "ID:         #{custom_field_value.id}"
    puts "Label:      #{custom_field_value.label}"
    puts "Type:       #{custom_field_value.type}"
    puts "Sort order: #{custom_field_value.sort_order}"
  end
end

# Update a custom field value
#
custom_field = workspace.custom_fields(:first) # Access the first custom field
task = workspace.tasks(:first)                 # Access the first task

task.custom_field_values = { custom_field.name => custom_field.values.first.label }
task.save

Time Tracking

workspace = lp.workspaces(7)                # Access workspace by ID

task = workspace.tasks(                     # Get my first unfinished task
  :first, 
  :filter => ['owner_id = me', 'is_done is false']
) 

task.track_time(
  :work        => 4,                        # Log 4 hours of work 
  :activity_id => task.activities.first.id
)

Development

  1. Fork this project
  2. Make changes
  3. Add tests for your changes
  4. Commit
  5. Submit a pull request

LiquidPlanner's Projects

country-select icon country-select

This is a fork from the original (and long dead) iso-3166-country-select Rails plugin to make it available as a gem and update it as necessary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.