module Roda::Endpoints::Endpoint::Namespace
Namespacing operations, validations, etc.
Attributes
name[R]
@return [Symbol]
ns[R]
@return [String]
parent[R]
@return [Endpoint]
Public Class Methods
included(child)
click to toggle source
# File lib/roda/endpoints/endpoint/namespace.rb, line 9 def self.included(child) child.attributes += %i(name ns parent) end
new(name:, ns: name.to_s, parent: Undefined, **attributes)
click to toggle source
@param name [Symbol] @param ns [String] @param attributes [{Symbol=>Object}] @param parent [Endpoint?]
Calls superclass method
# File lib/roda/endpoints/endpoint/namespace.rb, line 17 def initialize(name:, ns: name.to_s, parent: Undefined, **attributes) @name = name @ns = ns unless parent == Undefined @parent = parent @ns = [parent.ns, ns].compact.join('.') end super(name: name, **attributes) end