lib/nrser/props/instance_methods.rb
# Create a new hash with property names mapped to values.
# 
# @param [Boolean] only_own
#   When `true`, don't include parent properties.
# 
# @param [Boolean] only_primary
#   When `true`, don't include sourced properties.
# 
# @return [Hash<Symbol, Object>]
#   Map of prop names to values.
# 
Create a new hash with property names mapped to values.
Create a new hash with property names mapped to values .
def to_h only_own: false, only_primary: false, compact: true
    hash = self.class.
      props(only_own: only_own, only_primary: only_primary).
      transform_values { |prop| prop.get self }
    hash.compact! if compact
    hash
  end
def to_h only_own : false , only_primary : false , compact : true hash = self . class . props ( only_own : only_own , only_primary : only_primary ) . transform_values { | prop | prop . get self } hash . compact! if compact hash end
Create a new hash with property names mapped to values.
Create a new hash with property names mapped to values .
Map of prop names to values.
Map of prop names to values .
Hash<Symbol, Object>
only_own
<not_specific>
only_primary
<not_specific>
compact
<not_specific>
<not_specific>
only_primary When `true`, don't include sourced properties.
only_primary When ` true ` don ' t include sourced properties .