Module: Hash19::Core
- Extended by:
- ActiveSupport::Concern
- Includes:
- Resolvers
- Included in:
- Hash19
- Defined in:
- lib/hash19/core.rb
Defined Under Namespace
Modules: ClassMethods, Initializer
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Resolvers
#resolve_aliases, #resolve_associations, #resolve_class, #resolve_has_many, #resolve_has_one, #resolve_injections
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/hash19/core.rb', line 34 def method_missing(m, *args, &block) if @hash19.respond_to? m @hash19.send(m, *args, &block) else super end end |
Class Method Details
.included(klass) ⇒ Object
30 31 32 |
# File 'lib/hash19/core.rb', line 30 def self.included(klass) klass.send :prepend, Initializer end |
Instance Method Details
#to_h(lazy = false) ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/hash19/core.rb', line 42 def to_h(lazy=false) return @hash19 if lazy if @hash19.is_a? Array @hash19.map { |hash| traverse_hash(hash) } else traverse_hash(@hash19) end end |