This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
|
||||
module WikiAssetRepr
|
||||
BASE = { only: [:wiki_page_id, :no], methods: [:url] }.freeze
|
||||
|
||||
module_function
|
||||
|
||||
def base wiki_asset
|
||||
wiki_asset.as_json(BASE)
|
||||
end
|
||||
|
||||
def many wiki_assets
|
||||
wiki_assets.map { |a| base(a) }
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user