Class: Fellowshipone::Client

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Methods included from PledgeDrive

#list_pledge_drives

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

#fund, #funds, #subfunds

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_codeObject (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_keyObject (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_secretObject (readonly)

Returns the value of attribute consumer_secret.



17
18
19
# File 'lib/fellowshipone/client.rb', line 17

def consumer_secret
  @consumer_secret
end

#loggerObject (readonly)

Returns the value of attribute logger.



17
18
19
# File 'lib/fellowshipone/client.rb', line 17

def logger
  @logger
end

#secretObject (readonly)

Returns the value of attribute secret.



17
18
19
# File 'lib/fellowshipone/client.rb', line 17

def secret
  @secret
end

#tokenObject (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, options = {})
  connection.delete(path, options).body
end

#get(path, options = {}) ⇒ Object



28
29
30
# File 'lib/fellowshipone/client.rb', line 28

def get(path, options = {})
  connection.get(path, options).body
end

#post(path, options = {}) ⇒ Object



32
33
34
# File 'lib/fellowshipone/client.rb', line 32

def post(path, options = {})
  connection.post(path, options).body
end

#put(path, options = {}) ⇒ Object



36
37
38
# File 'lib/fellowshipone/client.rb', line 36

def put(path, options = {})
  connection.put(path, options).body
end

#saveObject



44
45
46
# File 'lib/fellowshipone/client.rb', line 44

def save
  connection.put(path, {}).body
end