yard Questions
2
Solved
I have a method that looks like this:
def get_endpoint(params: {})
end
I want the caller of this method to be able to pass in a few optional parameters.
I want to write YARD documentation to su...
2
Solved
I have a function that take a variable number of arguments, like this:
def myfun(*args)
# ...
end
All args are of the same type (Symbol), so right now I document the function like if there were...
Garfieldgarfinkel asked 27/4, 2014 at 20:11
1
I want to link to another extra file from my README using Yard.
For example, I have the following line:
...detailed instructions [here](contributing.md) on how to contribute
I want this to l...
Wharton asked 29/11, 2014 at 22:13
0
I would like to better document the return type of this naïve memoization method using YARD:
# Ensures that given block is only executed exactly once and on subsequent
# calls returns result from f...
Ultraviolet asked 22/12, 2020 at 17:24
0
I have an object with a method returning a lambda:
class Book
def mark_page(marker_color)
lambda do |page|
page.mark(marker_color)
end
end
end
And I want to document this Book#mark_page met...
Delphiadelphic asked 22/1, 2020 at 10:7
0
I have a module I include to help define certain methods, constants and class methods. It is creating them all dynamically. I need help understanding how I can use Yard Doc's @macro feature to alig...
Indeliberate asked 19/12, 2019 at 19:35
2
Solved
Consider a code like this:
module Foo
# returns a copy of self
# @return [ ___ ]
def returns_new_self
self.class.new
end
end
class Bar
include Foo
end
class Zap
include Foo
end
With thi...
1
I have a class that I create from a factory function like this:
Cake = MyProject.Struct(:type, :price)
In Yard, it's simply displayed along with my constants:
Cake =
Struct(:type, :price)
I ...
2
Solved
Is there any way to tell Yard not to clutter up my Rails project's doc/ folder? I'd like it to save its files in doc/yard/ or something like that. Sadly I didn't find any option for that.
Thank yo...
1
Solved
In the official YARD docs, there is the following example:
# @overload set(key, value)
# Sets a value on key
# @param key [Symbol] describe key param
# @param value [Object] describe value para...
3
Solved
I have a class that uses the def_delegators method from the Forwardable module. I haven't found a way to get Yardoc to output documentation for it. I've tried using a macro but it won't output anyt...
Precontract asked 15/2, 2013 at 9:9
2
Solved
I need to tag the @return type of a method that returns a class instead of an instance. Example:
# @return [String] # This implies that the return type is a String object
def string_class
String ...
3
I've got what i assumed was a fairly basic yard macro usage where i have a Hash structure with a number of options that is shared between multiple functions. I was hoping to use a macro simply to p...
Inveigh asked 7/9, 2012 at 1:18
1
If I have a function that returns this:
render :json => @orders.as_json(include: [{:user => {only: :id}}], :only => [:id, :status_id])
I am documenting it like this:
# @return [JSON] ...
Janka asked 4/6, 2014 at 21:58
3
Solved
I want to include image in yard-genereted documentation, but can't find anywhere how to do this... Does anyone know how to do this?
1
I'm currently working on a gem and writing documentation for it. I currently have a class that has several method defined using defined_method as follows:
class Client
['one', 'two'].each do |met...
Johnnajohnnie asked 1/9, 2016 at 8:48
0
I need to change the structure of the HTML documentation generated by Yard; there isn't much in common with the default HTML template.
As I understand it, the solution to this is to create a new Y...
1
I would like to include information on the Rake tasks in our Rails app. We use YARD for documentation, and at the moment pages like lib/tasks/development.rake show up by default as unformatted text...
Hols asked 22/4, 2015 at 15:32
2
I have an ActiveRecord class similar to this:
class User < ActiveRecord::Base
# How do I document this?
enum status [:registering, :active, :suspended, :deleted]
end
status attribute is us...
Gober asked 31/10, 2015 at 16:3
2
I'm using yard to generate my documentation for Rails apps from an rdoc file. There are AngularJS documentation generators, but how could they be connected to generate one coherent document f...
Koblenz asked 2/8, 2015 at 16:59
1
Solved
I have a method that should take 1+ parameters of any class, similar to Array#push:
def my_push(*objects)
raise ArgumentError, 'Needs 1+ arguments' if objects.empty?
objects.each do |obj| ...
Polygamous asked 23/5, 2015 at 18:28
3
Solved
I'm in the process of switching over a rubygem I maintain from RDoc to YARD documentation. However, there are some critical comments in the code that need to remain only in the code and should not ...
1
I have some Ruby code that looks like this:
# some_string = "{really?}"
where the curly braces need to be part of the string. This line is commented out code that I'd like to remain there. I'm a...
2
I have a typical OO pattern: one base abstract class (that defines abstract methods) and several classes that implement these abstract methods in class-specific way.
I'm used to write documentatio...
Sold asked 15/10, 2013 at 10:39
1
Solved
I am using YARD to document one of my Ruby projects. I have certain methods that I do not want to be included in the documentation, things like #inspect and #to_s that you expect to exist and retur...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.