Officepod Build Status

This gem helps separate concerns of the complicating Officepod logics.
All of Officepod-specific logics happens behind the scenes.
You just cast the spell on your place!

Install

Add this line to your application's Gemfile:

gem 'officepod'

And then execute:

$ bundle

Or install it yourself as:

$ gem install officepod

Requirements

  • Ruby 2.2.4 or higher
  • json
  • HTTParty

Usage

class Api::UsersController < ApplicationController
  include Officepod
  before_filter :user_params

  def 
    body = {
        'command': 'login',
        'device_id': '',
        'install_ver': '',
        'ip': 'localhost:3000',
        'lang': 'ko',
        'str': 'dGVzdHtHU310ZXN0'
    }
    o = Officepod::Base.new("login", body)
    response = o.operate
    respond_to do |format|
      format.json { render json: response, status: 200 }
    end
  end

  def logout
    o = Officepod::Base.new("logout", body)
    response = o.operate
    respond_to do |format|
      format.json { render json: response, status: 200 }
    end
  end

  private
  def user_params
    params.require(:user).permit!
  end
end

Help and Docs

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  • Fork the project.
  • Run bundle
  • Run bundle exec rake
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Run bundle exec rake (No, REALLY :))
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself in another branch so I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

License

The gem is available as open source under the terms of the MIT License.