module YardSequel::Associations::ToOneMethods

Provides methods for creating the to_one method objects. @author Kai Moschcau

Public Instance Methods

create_to_one_getter() click to toggle source

@return [YARD::CodeObjects::MethodObject] the to_one getter method

object.
# File lib/yard-sequel/associations/modules/to_one_methods.rb, line 10
def create_to_one_getter
  name   = association_name
  method = create_method_object name
  return_tag(method, association_full_class,
             "the associated #{association_class}.")
  method
end
create_to_one_setter() click to toggle source

@return [YARD::CodeObjects::MethodObject] the to_one setter method

object.
# File lib/yard-sequel/associations/modules/to_one_methods.rb, line 20
def create_to_one_setter
  name             = association_name
  method           = create_method_object "#{name}="
  method.docstring += "Associates the passed #{association_class} "\
                      'with `self`.'
  add_param_tag(method, name, association_full_class,
                "The #{association_class} to associate with `self`.")
  return_tag(method, association_full_class,
             "the associated #{association_class}.")
  method
end