teamsnap_rb 2.0.0.beta6 → 2.0.0.beta7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -0
- data/lib/teamsnap/item.rb +9 -2
- data/lib/teamsnap/version.rb +1 -1
- data/spec/cassettes/apiv3-init.yml +241 -166
- data/spec/cassettes/teamsnap__client/when_calling_via_s_on_the_client/does_not_raise_an_error_when_the_HTTP_actions_are_called.yml +12 -10
- data/spec/cassettes/teamsnap__client/when_calling_via_s_on_the_client/passes_them_to_the_faraday_client_using_method_missing.yml +12 -10
- data/spec/cassettes/teamsnap__collection/adds_find_if_search_is_available.yml +19 -14
- data/spec/cassettes/teamsnap__collection/adds_href_to_items.yml +20 -13
- data/spec/cassettes/teamsnap__collection/can_follow_plural_links.yml +87 -45
- data/spec/cassettes/teamsnap__collection/can_follow_singular_links.yml +39 -27
- data/spec/cassettes/teamsnap__collection/can_handle_links_with_no_data.yml +28 -21
- data/spec/cassettes/teamsnap__collection/handles_executing_an_action_via_commands.yml +20 -13
- data/spec/cassettes/teamsnap__collection/handles_executing_an_action_via_commands_with_multiple_params.yml +19 -11
- data/spec/cassettes/teamsnap__collection/handles_fetching_data_via_queries.yml +19 -14
- data/spec/cassettes/teamsnap__collection/handles_queries_with_no_data.yml +15 -11
- data/spec/cassettes/teamsnap__collection/raises_an_exception_if_find_returns_nothing.yml +15 -11
- data/spec/cassettes/teamsnap__collection/supports_relations_with_expected_behaviors/when_a_plural_relation_is_called/responds_with_an_array_of_objects_when_successful.yml +26 -24
- data/spec/cassettes/teamsnap__collection/supports_relations_with_expected_behaviors/when_a_plural_relation_is_called/responds_with_an_empty_array_when_no_objects_exist.yml +22 -20
- data/spec/cassettes/teamsnap__collection/supports_relations_with_expected_behaviors/when_a_singular_relation_is_called/responds_with_nil_if_it_does_NOT_exist.yml +25 -22
- data/spec/cassettes/teamsnap__collection/supports_relations_with_expected_behaviors/when_a_singular_relation_is_called/responds_with_the_object_if_it_exists.yml +33 -26
- data/spec/cassettes/teamsnap__structure/_create_collection_class/registers_new_classes_via_introspection_of_the_root_collection.yml +15 -11
- data/spec/cassettes/teamsnap__structure/_create_collection_class/sets_the_href_attribute_on_the_new_class.yml +15 -11
- data/spec/cassettes/teamsnap__structure/_init/has_all_classes_in_schema_loaded_except_for_exceptions_list_endpoints.yml +12 -10
- data/spec/cassettes/teamsnap_rb/_bulk_load/can_handle_an_empty_bulk_load.yml +8 -8
- data/spec/cassettes/teamsnap_rb/_bulk_load/can_handle_an_error_with_bulk_load_without_a_team_id.yml +6 -6
- data/spec/cassettes/teamsnap_rb/_bulk_load/can_use_bulk_load.yml +65 -32
- data/spec/cassettes/teamsnap_rb/_client_send/when_sent_a_known_via_/calls_DELETE_on_the_given_client.yml +242 -85
- data/spec/cassettes/teamsnap_rb/_client_send/when_sent_a_known_via_/calls_GET_on_the_given_client.yml +12 -10
- data/spec/cassettes/teamsnap_rb/_client_send/when_sent_a_known_via_/calls_PATCH_on_the_given_client.yml +242 -85
- data/spec/cassettes/teamsnap_rb/_client_send/when_sent_a_known_via_/calls_POST_on_the_given_client.yml +242 -85
- data/spec/cassettes/teamsnap_rb/_run/processes_the_response.yml +48 -40
- data/spec/spec_helper.rb +1 -0
- data/spec/teamsnap/item_spec.rb +35 -0
- data/spec/teamsnap_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bbbfb0eb985d89e7009bf7956ceaab3147713ea
|
4
|
+
data.tar.gz: 05d0073aee1f78775dcd9ec7e4b529edf2f8b460
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce2af9e4cea53fdeb17012de5b81c570161276c26b910990ad6096c9b28166dd2bbafbdecc59c6b45524942bbb40e390e83e11a3f6147c4b542d2e8841d97da7
|
7
|
+
data.tar.gz: e5fc0b16bb19697e977f2f16f5cfda71bc9059e46db8a81bd62d14762b5821ee4888dfba8ae906945b58850060eb3eff6c9d8efabf74a0801505317cbbda854c
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/teamsnap/item.rb
CHANGED
@@ -42,12 +42,19 @@ module TeamSnap
|
|
42
42
|
|
43
43
|
def load_class(type, data)
|
44
44
|
TeamSnap.const_get(Inflecto.camelize(type), false).tap { |cls|
|
45
|
-
|
45
|
+
if cls.include?(Virtus::Model::Core)
|
46
|
+
cls.class_eval do
|
47
|
+
attributes = cls.attribute_set.map(&:name)
|
48
|
+
data
|
49
|
+
.select { |name, _| !attributes.include?(name.to_sym) }
|
50
|
+
.each { |name, value| attribute name, value.class }
|
51
|
+
end
|
52
|
+
else
|
46
53
|
cls.class_eval do
|
47
54
|
include Virtus.value_object
|
48
55
|
|
56
|
+
attribute :href, String
|
49
57
|
values do
|
50
|
-
attribute :href, String
|
51
58
|
data.each { |name, value| attribute name, value.class }
|
52
59
|
end
|
53
60
|
end
|
data/lib/teamsnap/version.rb
CHANGED