Class: Freee::Section

Inherits:
Base
  • Object
show all
Defined in:
lib/freee/section.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Class Method Summary collapse

Methods inherited from Base

config, #get, #initialize, #post, set_env, #token, #token=

Constructor Details

This class inherits a constructor from Freee::Base

Class Method Details

.create(json) ⇒ Object



3
4
5
6
# File 'lib/freee/section.rb', line 3

def self.create(json)
  params = Freee.encode_json(json)
  Freee.client.post('/api/1/sections', :section, params)
end

.list(company_id) ⇒ Object



8
9
10
11
12
13
# File 'lib/freee/section.rb', line 8

def self.list(company_id)
  Freee.client.get(
    "/api/1/sections?company_id=#{company_id.to_i}",
    :section
  )
end