lib/wcc/media/speaker.rb in wcc-media-client-0.1.1 vs lib/wcc/media/speaker.rb in wcc-media-client-0.2.0
- old
+ new
@@ -1,31 +1,29 @@
-module WCC
- module Media
- class Speaker
- include WCC::Media::Cacheable
+require_relative 'base'
- attr_reader :raw, :headers
+class WCC::Media::Speaker < WCC::Media::Base
+ active_record_shim do
+ endpoint 'speakers'
+ filters %w[
+ featured
+ name_like
+ tag_id
+ ]
+ end
- def initialize(raw, headers = {})
- @raw = raw
- @headers = headers
- end
+ def id
+ raw['id']&.to_s
+ end
- def id
- raw['id']&.to_s
- end
+ def legacy_id
+ raw['legacy_id']&.to_s
+ end
- def legacy_id
- raw['legacy_id']&.to_s
- end
-
- %w[
- featured
- name
- ].each do |att|
- define_method att do
- raw[att]
- end
- end
+ %w[
+ featured
+ name
+ ].each do |att|
+ define_method att do
+ raw[att]
end
end
end
\ No newline at end of file