Class: NRSER::Meta::Props::Base

Inherits:
Object
  • Object
show all
Includes:
NRSER::Meta::Props
Defined in:
lib/nrser/meta/props/base.rb

Overview

Definitions

Constant Summary

Constants included from NRSER::Meta::Props

DEFAULT_CLASS_KEY, PROPS_VARIABLE_NAME, PROP_VALUES_VARIABLE_NAME

Instance Method Summary collapse

Methods included from NRSER::Meta::Props

UNSAFE_load_instance_from_data, get_props_ref, included, #initialize_props, #merge, #to_data, #to_h, #to_json, #to_yaml

Constructor Details

#initialize(**values) ⇒ Base

Returns a new instance of Base.



13
14
15
# File 'lib/nrser/meta/props/base.rb', line 13

def initialize **values
  initialize_props values
end

Instance Method Details

#to_sString

TODO:

Prob wanna improve this at some point, but it’s better than nothing.

Returns a short string describing the instance.

Returns:

  • (String)

    a short string describing the instance.



22
23
24
25
26
27
28
29
30
# File 'lib/nrser/meta/props/base.rb', line 22

def to_s
  props_str = self.class.props( only_primary: true ).sort.map { |name, prop|
    "#{ name }=#{ prop.get( self ).inspect }"
  }.join ' '
  
  <<-END.squish
    #<#{ self.class.name } #{ props_str }>
  END
end