Class: Fellowshipone::Client
- Inherits:
-
Object
- Object
- Fellowshipone::Client
- Includes:
- Communication, Contribution, Fund, Household, Person, PledgeDrive
- Defined in:
- lib/fellowshipone/client.rb,
lib/fellowshipone/resources/fund.rb,
lib/fellowshipone/resources/person.rb,
lib/fellowshipone/resources/household.rb,
lib/fellowshipone/resources/contribution.rb,
lib/fellowshipone/resources/pledge_drive.rb,
lib/fellowshipone/resources/communication.rb
Defined Under Namespace
Modules: Communication, Contribution, Fund, Household, Person, PledgeDrive
Instance Attribute Summary collapse
-
#church_code ⇒ Object
readonly
Returns the value of attribute church_code.
-
#consumer_key ⇒ Object
readonly
Returns the value of attribute consumer_key.
-
#consumer_secret ⇒ Object
readonly
Returns the value of attribute consumer_secret.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #delete(path, options = {}) ⇒ Object
- #get(path, options = {}) ⇒ Object
-
#initialize(church_code:, consumer_key:, consumer_secret:, token:, secret:, logger: false) ⇒ Client
constructor
A new instance of Client.
- #post(path, options = {}) ⇒ Object
- #put(path, options = {}) ⇒ Object
- #save ⇒ Object
Methods included from PledgeDrive
Methods included from Person
#create_person, #find_person, #list_people, #new_person, #search_for_person, #search_for_person_by_household, #search_people_by_date
Methods included from Household
#create_household, #find_household, #new_household
Methods included from Fund
Methods included from Contribution
#create_contribution, #get_contribution, #new_contribution, #search_contributions, #update_contribution
Methods included from Communication
#create_communication, #new_communication
Constructor Details
#initialize(church_code:, consumer_key:, consumer_secret:, token:, secret:, logger: false) ⇒ Client
Returns a new instance of Client.
19 20 21 22 23 24 25 26 |
# File 'lib/fellowshipone/client.rb', line 19 def initialize(church_code:, consumer_key:, consumer_secret:, token:, secret:, logger: false) @church_code = church_code @consumer_key = consumer_key @consumer_secret = consumer_secret @token = token @secret = secret @logger = logger end |
Instance Attribute Details
#church_code ⇒ Object (readonly)
Returns the value of attribute church_code.
17 18 19 |
# File 'lib/fellowshipone/client.rb', line 17 def church_code @church_code end |
#consumer_key ⇒ Object (readonly)
Returns the value of attribute consumer_key.
17 18 19 |
# File 'lib/fellowshipone/client.rb', line 17 def consumer_key @consumer_key end |
#consumer_secret ⇒ Object (readonly)
Returns the value of attribute consumer_secret.
17 18 19 |
# File 'lib/fellowshipone/client.rb', line 17 def consumer_secret @consumer_secret end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
17 18 19 |
# File 'lib/fellowshipone/client.rb', line 17 def logger @logger end |
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
17 18 19 |
# File 'lib/fellowshipone/client.rb', line 17 def secret @secret end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
17 18 19 |
# File 'lib/fellowshipone/client.rb', line 17 def token @token end |
Instance Method Details
#delete(path, options = {}) ⇒ Object
40 41 42 |
# File 'lib/fellowshipone/client.rb', line 40 def delete(path, = {}) connection.delete(path, ).body end |
#get(path, options = {}) ⇒ Object
28 29 30 |
# File 'lib/fellowshipone/client.rb', line 28 def get(path, = {}) connection.get(path, ).body end |
#post(path, options = {}) ⇒ Object
32 33 34 |
# File 'lib/fellowshipone/client.rb', line 32 def post(path, = {}) connection.post(path, ).body end |
#put(path, options = {}) ⇒ Object
36 37 38 |
# File 'lib/fellowshipone/client.rb', line 36 def put(path, = {}) connection.put(path, ).body end |
#save ⇒ Object
44 45 46 |
# File 'lib/fellowshipone/client.rb', line 44 def save connection.put(path, {}).body end |