Module: Jbr::Includable
Overview
Extends a list of records with the chaining that says what to bring back beside them. Nothing extra comes back unasked: a page costs what it carries.
Instance Method Summary collapse
-
#includes(*names) ⇒ Resource
The same list, asking Jobber for those too.
Instance Method Details
#includes(*names) ⇒ Resource
Returns the same list, asking Jobber for those too.
8 9 10 11 12 13 |
# File 'lib/jbr/includable.rb', line 8 def includes(*names) named = names.each_with_object({}) do |name, all| name.is_a?(Hash) ? all.merge!(name) : all[name] = nil end self.class.new oauth: @oauth, includes: @includes.merge(named) end |