class ActiveResource::Reflection::AssociationReflection
Attributes
Returns the macro type.
has_many :clients returns :has_many
Returns the name of the macro.
has_many :clients returns :clients
Returns the hash of options used for the macro.
has_many :clients returns +{}+
Public Class Methods
Source
# File lib/active_resource/reflection.rb, line 30 def initialize(macro, name, options) @macro, @name, @options = macro, name, options end
Public Instance Methods
Source
# File lib/active_resource/reflection.rb, line 59 def class_name @class_name ||= derive_class_name end
Returns the class name for the macro.
has_many :clients returns 'Client'
Source
# File lib/active_resource/reflection.rb, line 64 def foreign_key @foreign_key ||= derive_foreign_key end
Returns the foreign_key for the macro.
Source
# File lib/active_resource/reflection.rb, line 52 def klass @klass ||= class_name.constantize end
Returns the class for the macro.
has_many :clients returns the Client class