Skip to content

Commit

Permalink
improve documentation based on feedback from Inch CI 👍
Browse files Browse the repository at this point in the history
  • Loading branch information
whoward committed Mar 9, 2015
1 parent 49334c3 commit 3ef574d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/cadenza/block_hierarchy.rb
Expand Up @@ -16,7 +16,9 @@ def initialize(data=nil)
merge(data) if data
end

# @return [Array] the inheritance chain for the given block name
# fetches the inheritance chain for the given block name. if the block
# name is undefined then an empty array is returned.
# @return [Array] the inheritance chain
def fetch(block_name)
@names[block_name.to_s] || []
end
Expand Down
31 changes: 29 additions & 2 deletions lib/cadenza/library/functions.rb
Expand Up @@ -12,30 +12,57 @@ def self.const_missing(const_name)
module Library
module Functions

# @!attribute [r] functions
# @return [Hash] the function names mapped to their implementing procs
# @deprecated Use {#functions} instead
def functional_variables
warn "`#functional_variables` has been deprecated. Use `#functions` instead."
functions
end

# looks up the function by name
#
# @raise [FunctionNotDefinedError] if the function can not be found
# @param [Symbol] name the name of the function to look up
# @return [Proc] the function implementation
# @deprecated Use {#lookup_function} instead
def lookup_functional_variable(name)
warn "`#lookup_functional_variable` has been deprecated. Use `#lookup_function` instead."
lookup_function(name)
end


# defines a function proc with the given name
#
# @param [Symbol] name the name for the template to use for this variable
# @yield [Context, *args] the block will receive the context object and a
# variable number of arguments passed to the variable.
# @return nil
# @deprecated Use {#define_function} instead
def define_functional_variable(name, &block)
warn "`#define_functional_variable` has been deprecated. Use `#define_function` instead."
define_function(name, &block)
end

# @deprecated Use {#alias_functional_variable} instead
# creates an alias of the given function name under a different name
#
# @raise [FunctionNotDefinedError] if the original function name isn't defined
# @param [Symbol] original_name the original name of the function
# @param [Symbol] alias_name the new name of the function
# @return nil
# @deprecated Use {#alias_function} instead
def alias_functional_variable(original_name, alias_name)
warn "`#alias_functional_variable` has been deprecated. Use `#alias_function` instead."
alias_function(original_name, alias_name)
end

# calls the defined function proc with the given parameters and returns
# the result.
#
# @raise [FunctionNotDefinedError] if the named function doesn't exist
# @param [Symbol] name the name of the function to evaluate
# @param [Array] params a list of parameters to pass to the function
# block when calling it
# @return [Object] the result of evaluating the function
# @deprecated Use {#evaluate_function} instead
def evaluate_functional_variable(name, context, params=[])
warn "`#evaluate_functional_variable` has been deprecated. Use `#evaluate_function` instead."
Expand Down
2 changes: 1 addition & 1 deletion lib/cadenza/nodes/boolean_inverse_node.rb
Expand Up @@ -9,7 +9,7 @@ class BooleanInverseNode
attr_accessor :expression

# creates a new {BooleanInverseNode} with the given expression
# @param [OperationNode] the node this one will invert
# @param [OperationNode] expression the node this one will invert
def initialize(expression)
@expression = expression
end
Expand Down
2 changes: 1 addition & 1 deletion lib/cadenza/nodes/filtered_value_node.rb
Expand Up @@ -13,7 +13,7 @@ class FilteredValueNode
attr_accessor :filters

# creates a new {FilteredValueNode}.
# @param [String] identifier see {#identifier}
# @param [String] value see {#value}
# @param [Array] filters see {#filters}
def initialize(value, filters=[])
@value = value
Expand Down

0 comments on commit 3ef574d

Please sign in to comment.