module ActiveGraph::Shared::TypecastedAttributes::ClassMethods
Public Instance Methods
_attribute_type(attribute_name)
click to toggle source
Calculates an attribute type
@private
# File lib/active_graph/shared/typecasted_attributes.rb 90 def _attribute_type(attribute_name) 91 attributes[attribute_name].type || Object 92 end
inspect()
click to toggle source
Returns the class name plus its attribute names and types
@example Inspect the model's definition.
Person.inspect
@return [String] Human-readable presentation of the attributes
# File lib/active_graph/shared/typecasted_attributes.rb 81 def inspect 82 inspected_attributes = attribute_names.sort.map { |name| "#{name}: #{_attribute_type(name)}" } 83 attributes_list = "(#{inspected_attributes.join(', ')})" unless inspected_attributes.empty? 84 "#{name}#{attributes_list}" 85 end
typecast_attribute(typecaster, value)
click to toggle source
# File lib/active_graph/shared/typecasted_attributes.rb 94 def typecast_attribute(typecaster, value) 95 ActiveGraph::Shared::TypeConverters.typecast_attribute(typecaster, value) 96 end