module Horza
Helper module to allow other libraries to access the global Horza
configuration instance and dispatch methods accordingly.
Constants
- VERSION
Public Class Methods
adapt(klass)
click to toggle source
# File lib/horza.rb, line 43 def adapt(klass) adapter.new(klass) end
collection(items = [])
click to toggle source
# File lib/horza.rb, line 51 def collection(items = []) Horza::Entities::Collection.new(items) end
configuration()
click to toggle source
# File lib/horza.rb, line 27 def configuration @configuration ||= Configuration.new end
configure() { |configuration| ... }
click to toggle source
# File lib/horza.rb, line 35 def configure yield(configuration) end
descendants_map(klass)
click to toggle source
# File lib/horza.rb, line 39 def descendants_map(klass) klass.descendants.reduce({}) { |hash, (klass)| hash.merge(klass.name.split('::').last.underscore.to_sym => klass) } end
reset()
click to toggle source
# File lib/horza.rb, line 31 def reset @configuration = nil end
single(params = {})
click to toggle source
# File lib/horza.rb, line 47 def single(params = {}) Horza::Entities::Single.new(params) end