Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Jan 21, 2024
1 parent c2850ef commit a150026
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/hawk/linker.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Hawk
# Allows adding to any Ruby object an accessor referencing an {Hawk::Model}.
#
# Example, assuming Bar is defined and Foo responds_to `bar_id`:
# Example, assuming Bar is defined and Foo responds_to +bar_id+:
#
# class Foo
# include Hawk::Linker
Expand Down
6 changes: 2 additions & 4 deletions lib/hawk/model/association.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def inherited(subclass)
# Example (for Joe :-)
#
# class Foo < Hawk::Model::Base
#
# has_many :bars
#
# preload_association do |attributes, name, type, options|
Expand All @@ -105,11 +104,10 @@ def inherited(subclass)
# end
# end
# end
#
# end
#
# The block would get called once, with :bars as `name`, :has_many as
# `type` and `{class_name:'Bar', primary_key:'foo_id'}` as `options`.
# The block would get called once, with :bars as +name+, :has_many as
# +type+ and +{ class_name: "Bar", primary_key : "foo_id" }+ as +options+.
#
# By default it looks up in the representation a property named after
# the association's name and returns it, deleting it from the repr.
Expand Down
4 changes: 2 additions & 2 deletions lib/hawk/model/lookup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ def inherited(subclass)
#
# App::Post.model_class_for('Comment')
#
# will return `App::Comment`
# will return +App::Comment+
#
# while
#
# Client::Post.model_class_for('Comment')
#
# will return `Client::Comment`
# will return +Client::Comment+
#
# In a nutshell, first the model namespace is checked,
# then the containing namespace, and then the inheritance
Expand Down
4 changes: 2 additions & 2 deletions lib/hawk/model/querying.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def default_params(params = nil)
@_default_params ||= {}
end

# Adds `limit` with the given number of records
# Adds +limit+ with the given number of records
#
def limit(n)
where(limit_param => n)
end

# Adds an `offset` with the given number of records
# Adds an +offset+ with the given number of records
#
def offset(n)
where(offset_param => n)
Expand Down
1 change: 0 additions & 1 deletion lib/hawk/rake/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Utils
##
# Captures the stdout emitted by the given +block+
#
# @param block [Proc]
# @return [String] the captured output
#
def capture_stdout
Expand Down

0 comments on commit a150026

Please sign in to comment.