stbaldricks 12.2.1.alpha.1 → 12.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c031b82545a452644e576d669071e387a8d9b0523943fb8e5bfa0c4d9e22788
|
4
|
+
data.tar.gz: 6d7e6874655bffb32f6e64030b45605adfcb0a881916615bfbc805fbff47f197
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e6e2a26dcd90a49135dde10e918a9f1352690393d8c7951787f47ebc4115a017d3f129700042c4c9294a75b83f4e430d54be19f5e8298753e9030569132192f
|
7
|
+
data.tar.gz: 913b334fc9593a628e592283aeaefa7b126e3f73ba9ad05c08ebd81332eb2c124624db70b5881017279c95500384d3297a5d8f1241acf11158e22e774189f725
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'stbaldricks/api'
|
2
|
+
require 'stbaldricks/endpoints/lib/entity'
|
3
|
+
|
4
|
+
module SBF
|
5
|
+
module Client
|
6
|
+
class BlogPostEndpoint < SBF::Client::EntityEndpoint
|
7
|
+
FILTER_BY_AUTHOR = 'author'.freeze
|
8
|
+
FILTER_BY_CATEGORY = 'category'.freeze
|
9
|
+
FILTER_BY_TERM = 'filter_term'.freeze
|
10
|
+
FILTER_BY_TAG = 'tag'.freeze
|
11
|
+
|
12
|
+
def base_uri
|
13
|
+
"/#{SBF::Client::Api::VERSION}/blog_post"
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(slug)
|
17
|
+
response = SBF::Client::Api::Request.get_request("#{base_uri}/get/#{slug}")
|
18
|
+
|
19
|
+
if ok?(response)
|
20
|
+
hydrated_entity(response, {}, nil)
|
21
|
+
elsif response.code == 404
|
22
|
+
nil
|
23
|
+
else
|
24
|
+
parsed_response_body = JSON.parse(response.body).symbolize!
|
25
|
+
error = SBF::Client::ErrorEntity.new(parsed_response_body)
|
26
|
+
SBF::Client::Api::Response.new(http_code: response.code, data: parsed_response_body[:data], error: error)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def find_by_term(term, order = {}, limit = 10, offset = 0, show_hidden = true)
|
31
|
+
# Build the parameter list for search; an empty find is supported
|
32
|
+
filter = {}
|
33
|
+
filter[:type] = FILTER_BY_TERM
|
34
|
+
filter[:term] = term unless term.empty?
|
35
|
+
filter[:show_hidden] = show_hidden
|
36
|
+
|
37
|
+
find(filter, order, limit, offset)
|
38
|
+
end
|
39
|
+
|
40
|
+
def find_by_author(author, order = {}, limit = 10, offset = 0, show_hidden = true)
|
41
|
+
raise SBF::Client::Error, 'Must provide author for the query' if author.empty?
|
42
|
+
|
43
|
+
filter = {}
|
44
|
+
filter[:type] = FILTER_BY_AUTHOR
|
45
|
+
filter[:term] = author
|
46
|
+
filter[:show_hidden] = show_hidden
|
47
|
+
|
48
|
+
find(filter, order, limit, offset)
|
49
|
+
end
|
50
|
+
|
51
|
+
def find_by_category(category, order = {}, limit = 10, offset = 0, show_hidden = true)
|
52
|
+
raise SBF::Client::Error, 'Must provide category for the query' if category.empty?
|
53
|
+
|
54
|
+
filter = {}
|
55
|
+
filter[:type] = FILTER_BY_CATEGORY
|
56
|
+
filter[:term] = category
|
57
|
+
filter[:show_hidden] = show_hidden
|
58
|
+
|
59
|
+
find(filter, order, limit, offset)
|
60
|
+
end
|
61
|
+
|
62
|
+
def find_by_tag(tag, order = {}, limit = 10, offset = 0, show_hidden = true)
|
63
|
+
raise SBF::Client::Error, 'Must provide tag for the query' if tag.empty?
|
64
|
+
|
65
|
+
filter = {}
|
66
|
+
filter[:type] = FILTER_BY_TAG
|
67
|
+
filter[:term] = tag
|
68
|
+
filter[:show_hidden] = show_hidden
|
69
|
+
|
70
|
+
find(filter, order, limit, offset)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'stbaldricks/endpoints/blog_post'
|
2
|
+
require 'stbaldricks/entities/lib/top_level'
|
3
|
+
|
4
|
+
module SBF
|
5
|
+
module Client
|
6
|
+
module Blog
|
7
|
+
class Post < SBF::Client::TopLevelEntity
|
8
|
+
endpoint SBF::Client::BlogPostEndpoint
|
9
|
+
action :get
|
10
|
+
action :find_by_term
|
11
|
+
action :find_by_author
|
12
|
+
action :find_by_category
|
13
|
+
action :find_by_tag
|
14
|
+
|
15
|
+
attr_reader :id
|
16
|
+
attr_reader :slug
|
17
|
+
attr_reader :url
|
18
|
+
attr_reader :title
|
19
|
+
attr_reader :content
|
20
|
+
attr_reader :published_at
|
21
|
+
attr_reader :modified_at
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/stbaldricks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stbaldricks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.
|
4
|
+
version: 12.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -304,6 +304,7 @@ files:
|
|
304
304
|
- lib/stbaldricks/client.rb
|
305
305
|
- lib/stbaldricks/configuration.rb
|
306
306
|
- lib/stbaldricks/default_logger.rb
|
307
|
+
- lib/stbaldricks/endpoints/blog_post.rb
|
307
308
|
- lib/stbaldricks/endpoints/communicate.rb
|
308
309
|
- lib/stbaldricks/endpoints/config.rb
|
309
310
|
- lib/stbaldricks/endpoints/contact.rb
|
@@ -327,6 +328,7 @@ files:
|
|
327
328
|
- lib/stbaldricks/endpoints/shave_schedule.rb
|
328
329
|
- lib/stbaldricks/endpoints/user.rb
|
329
330
|
- lib/stbaldricks/entities/batch.rb
|
331
|
+
- lib/stbaldricks/entities/blog_post.rb
|
330
332
|
- lib/stbaldricks/entities/campaign.rb
|
331
333
|
- lib/stbaldricks/entities/challenge.rb
|
332
334
|
- lib/stbaldricks/entities/challenger.rb
|
@@ -555,9 +557,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
555
557
|
version: '0'
|
556
558
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
557
559
|
requirements:
|
558
|
-
- - "
|
560
|
+
- - ">="
|
559
561
|
- !ruby/object:Gem::Version
|
560
|
-
version:
|
562
|
+
version: '0'
|
561
563
|
requirements: []
|
562
564
|
rubygems_version: 3.0.3.1
|
563
565
|
signing_key:
|
@@ -565,99 +567,99 @@ specification_version: 4
|
|
565
567
|
summary: St. Baldrick's Foundation Ruby Client Library
|
566
568
|
test_files:
|
567
569
|
- lib/stbaldricks_factories.rb
|
568
|
-
- spec/factories/
|
569
|
-
- spec/factories/participant
|
570
|
-
- spec/factories/participant/roles/role.rb
|
571
|
-
- spec/factories/participant/policies.rb
|
572
|
-
- spec/factories/participant/totals.rb
|
573
|
-
- spec/factories/participant/roles.rb
|
574
|
-
- spec/factories/participant/rankings/ranking.rb
|
575
|
-
- spec/factories/search_fundraiser.rb
|
576
|
-
- spec/factories/newsletter_recipient.rb
|
577
|
-
- spec/factories/phone.rb
|
578
|
-
- spec/factories/contact_group.rb
|
579
|
-
- spec/factories/fundraiser/photos.rb
|
580
|
-
- spec/factories/fundraiser/policies.rb
|
581
|
-
- spec/factories/fundraiser/totals.rb
|
582
|
-
- spec/factories/team.rb
|
583
|
-
- spec/factories/venue.rb
|
584
|
-
- spec/factories/recurring_gift.rb
|
585
|
-
- spec/factories/donation/participant.rb
|
586
|
-
- spec/factories/error.rb
|
587
|
-
- spec/factories/grant_institution.rb
|
588
|
-
- spec/factories/page.rb
|
589
|
-
- spec/factories/grant.rb
|
570
|
+
- spec/factories/photo.rb
|
571
|
+
- spec/factories/participant.rb
|
590
572
|
- spec/factories/search_team.rb
|
591
|
-
- spec/factories/
|
592
|
-
- spec/factories/name_pieces.rb
|
593
|
-
- spec/factories/researcher.rb
|
594
|
-
- spec/factories/photos.rb
|
595
|
-
- spec/factories/donor.rb
|
596
|
-
- spec/factories/diagnosis.rb
|
573
|
+
- spec/factories/fund.rb
|
597
574
|
- spec/factories/kid_institution.rb
|
598
|
-
- spec/factories/
|
599
|
-
- spec/factories/
|
600
|
-
- spec/factories/photo.rb
|
601
|
-
- spec/factories/event.rb
|
602
|
-
- spec/factories/organization.rb
|
603
|
-
- spec/factories/campaign.rb
|
604
|
-
- spec/factories/kid/custom_institution.rb
|
605
|
-
- spec/factories/fundraising_page.rb
|
606
|
-
- spec/factories/contact.rb
|
607
|
-
- spec/factories/event_application.rb
|
575
|
+
- spec/factories/phone.rb
|
576
|
+
- spec/factories/diagnosis.rb
|
608
577
|
- spec/factories/location.rb
|
609
|
-
- spec/factories/
|
610
|
-
- spec/factories/
|
611
|
-
- spec/factories/challenger.rb
|
612
|
-
- spec/factories/treatment_status.rb
|
613
|
-
- spec/factories/institution.rb
|
614
|
-
- spec/factories/lib/helpers.rb
|
615
|
-
- spec/factories/lib/faker_patch.rb
|
616
|
-
- spec/factories/shave_schedule.rb
|
617
|
-
- spec/factories/address.rb
|
578
|
+
- spec/factories/event_application.rb
|
579
|
+
- spec/factories/search_event.rb
|
618
580
|
- spec/factories/shave_schedule/time_selection_permissions.rb
|
619
|
-
- spec/factories/person/phone_numbers.rb
|
620
|
-
- spec/factories/person/policies.rb
|
621
|
-
- spec/factories/person/addresses.rb
|
622
|
-
- spec/factories/person/email_addresses.rb
|
623
581
|
- spec/factories/collection.rb
|
624
|
-
- spec/factories/
|
625
|
-
- spec/factories/
|
626
|
-
- spec/factories/third_party_media.rb
|
627
|
-
- spec/factories/donation.rb
|
628
|
-
- spec/factories/person.rb
|
629
|
-
- spec/factories/team/rankings.rb
|
630
|
-
- spec/factories/team/photos.rb
|
631
|
-
- spec/factories/team/totals.rb
|
632
|
-
- spec/factories/team/rankings/ranking.rb
|
633
|
-
- spec/factories/kid_honor.rb
|
634
|
-
- spec/factories/disease.rb
|
635
|
-
- spec/factories/payment.rb
|
636
|
-
- spec/factories/search_kid.rb
|
637
|
-
- spec/factories/user.rb
|
582
|
+
- spec/factories/event.rb
|
583
|
+
- spec/factories/challenger.rb
|
638
584
|
- spec/factories/campaign/totals.rb
|
639
|
-
- spec/factories/
|
640
|
-
- spec/factories/
|
641
|
-
- spec/factories/
|
642
|
-
- spec/factories/
|
643
|
-
- spec/factories/
|
644
|
-
- spec/factories/
|
645
|
-
- spec/factories/
|
585
|
+
- spec/factories/kid_honor.rb
|
586
|
+
- spec/factories/response.rb
|
587
|
+
- spec/factories/grant_institution.rb
|
588
|
+
- spec/factories/organization.rb
|
589
|
+
- spec/factories/researcher.rb
|
590
|
+
- spec/factories/treatment_status.rb
|
591
|
+
- spec/factories/event/totals.rb
|
646
592
|
- spec/factories/event/contacts.rb
|
593
|
+
- spec/factories/event/photos.rb
|
594
|
+
- spec/factories/event/venue/location.rb
|
595
|
+
- spec/factories/event/venue/social.rb
|
596
|
+
- spec/factories/event/coach_tracking.rb
|
647
597
|
- spec/factories/event/venue.rb
|
598
|
+
- spec/factories/event/coach_tracking/coaching_interactions.rb
|
648
599
|
- spec/factories/event/coach_tracking/proceeds.rb
|
649
600
|
- spec/factories/event/coach_tracking/plaque.rb
|
650
|
-
- spec/factories/event/coach_tracking/coaching_interactions.rb
|
651
|
-
- spec/factories/event/photos.rb
|
652
|
-
- spec/factories/event/coach_tracking.rb
|
653
601
|
- spec/factories/event/contacts/name_pieces.rb
|
654
602
|
- spec/factories/event/contacts/contact.rb
|
655
|
-
- spec/factories/
|
656
|
-
- spec/factories/
|
657
|
-
- spec/factories/
|
658
|
-
- spec/factories/
|
603
|
+
- spec/factories/fundraiser/totals.rb
|
604
|
+
- spec/factories/fundraiser/policies.rb
|
605
|
+
- spec/factories/fundraiser/photos.rb
|
606
|
+
- spec/factories/shave_schedule.rb
|
659
607
|
- spec/factories/event_supporter.rb
|
660
|
-
- spec/factories/
|
608
|
+
- spec/factories/participant/totals.rb
|
609
|
+
- spec/factories/participant/policies.rb
|
610
|
+
- spec/factories/participant/roles/role.rb
|
611
|
+
- spec/factories/participant/photos.rb
|
612
|
+
- spec/factories/participant/rankings.rb
|
613
|
+
- spec/factories/participant/rankings/ranking.rb
|
614
|
+
- spec/factories/participant/roles.rb
|
615
|
+
- spec/factories/error.rb
|
616
|
+
- spec/factories/recurring_gift.rb
|
617
|
+
- spec/factories/challenge.rb
|
618
|
+
- spec/factories/address.rb
|
619
|
+
- spec/factories/kid/custom_institution.rb
|
620
|
+
- spec/factories/person.rb
|
621
|
+
- spec/factories/search_participant.rb
|
622
|
+
- spec/factories/milestone.rb
|
623
|
+
- spec/factories/fundraising_page.rb
|
624
|
+
- spec/factories/photos.rb
|
625
|
+
- spec/factories/team/totals.rb
|
626
|
+
- spec/factories/team/photos.rb
|
627
|
+
- spec/factories/team/rankings.rb
|
628
|
+
- spec/factories/team/rankings/ranking.rb
|
629
|
+
- spec/factories/donation.rb
|
630
|
+
- spec/factories/memorial.rb
|
631
|
+
- spec/factories/institution.rb
|
661
632
|
- spec/factories/memorial/totals.rb
|
662
633
|
- spec/factories/memorial/tribute.rb
|
634
|
+
- spec/factories/memorial/photos.rb
|
635
|
+
- spec/factories/person/policies.rb
|
636
|
+
- spec/factories/person/addresses.rb
|
637
|
+
- spec/factories/person/phone_numbers.rb
|
638
|
+
- spec/factories/person/email_addresses.rb
|
639
|
+
- spec/factories/donor.rb
|
640
|
+
- spec/factories/kid.rb
|
641
|
+
- spec/factories/name_pieces.rb
|
642
|
+
- spec/factories/team.rb
|
643
|
+
- spec/factories/user.rb
|
644
|
+
- spec/factories/disease.rb
|
645
|
+
- spec/factories/search_kid.rb
|
646
|
+
- spec/factories/page.rb
|
647
|
+
- spec/factories/venue.rb
|
648
|
+
- spec/factories/organization/addresses.rb
|
649
|
+
- spec/factories/organization/phone_numbers.rb
|
650
|
+
- spec/factories/organization/email_addresses.rb
|
651
|
+
- spec/factories/lib/faker_patch.rb
|
652
|
+
- spec/factories/lib/helpers.rb
|
653
|
+
- spec/factories/newsletter_recipient.rb
|
654
|
+
- spec/factories/payment.rb
|
655
|
+
- spec/factories/contact.rb
|
656
|
+
- spec/factories/message.rb
|
657
|
+
- spec/factories/search_fundraiser.rb
|
658
|
+
- spec/factories/third_party_media.rb
|
659
|
+
- spec/factories/donation/participant.rb
|
660
|
+
- spec/factories/grant.rb
|
661
|
+
- spec/factories/fundraiser.rb
|
662
|
+
- spec/factories/contact_group.rb
|
663
|
+
- spec/factories/email_address.rb
|
663
664
|
- spec/factories/permissions.rb
|
665
|
+
- spec/factories/campaign.rb
|