module ActiveTriples::Reflection::ClassMethods

Public Instance Methods

has_property?(property) click to toggle source

@param [#to_s] property

@return [Boolean] true if the property exsits; false otherwise

# File lib/active_triples/reflection.rb, line 64
def has_property?(property)
  _active_triples_config.keys.include? property.to_s
end
properties() click to toggle source

@return [Hash{String=>ActiveTriples::NodeConfig}] a hash of property

names and their configurations
# File lib/active_triples/reflection.rb, line 47
def properties
  _active_triples_config
end
properties=(val) click to toggle source

@param [Hash{String=>ActiveTriples::NodeConfig}] a complete config hash

to set the properties to.

@return [Hash{String=>ActiveTriples::NodeConfig}] a hash of property

names and their configurations
# File lib/active_triples/reflection.rb, line 56
def properties=(val)
  self._active_triples_config = val
end
reflect_on_property(property) click to toggle source

@param [#to_s] property

@return [ActiveTriples::NodeConfig] the configuration for the property

@raise [ActiveTriples::UndefinedPropertyError] when the property does

not exist
# File lib/active_triples/reflection.rb, line 38
def reflect_on_property(property)
  _active_triples_config.fetch(property.to_s) do
    raise ActiveTriples::UndefinedPropertyError.new(property.to_s, self)
  end
end