Class: Docks::Containers::Function
- Defined in:
- lib/docks/containers/function_container.rb
Overview
Public: a container for Function symbols.
Instance Attribute Summary
Attributes inherited from Symbol
#belongs_to, #methods, #properties
Class Method Summary collapse
Instance Method Summary collapse
- #instance? ⇒ Boolean
- #method? ⇒ Boolean
- #static? ⇒ Boolean
- #summary ⇒ Object
- #symbol_id ⇒ Object
- #to_descriptor ⇒ Object
Methods inherited from Symbol
#add_member, #add_members, #find, from_symbol, #has_members?, #initialize, #member?, #members, #private?, #public?
Methods inherited from Base
#==, #[], #[]=, #delete, #fetch, #find, #initialize, #method_missing, #respond_to?, #summarized?, #tags, #to_h, #update
Constructor Details
This class inherits a constructor from Docks::Containers::Symbol
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Docks::Containers::Base
Class Method Details
Instance Method Details
#instance? ⇒ Boolean
11 |
# File 'lib/docks/containers/function_container.rb', line 11 def instance?; !static? end |
#method? ⇒ Boolean
12 |
# File 'lib/docks/containers/function_container.rb', line 12 def method?; fetch(:method, false) end |
#static? ⇒ Boolean
10 |
# File 'lib/docks/containers/function_container.rb', line 10 def static?; fetch(:static, false) end |
#summary ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/docks/containers/function_container.rb', line 24 def summary summary = super summary.static = static? summary.method = method? summary.for = fetch(:for, nil) summary end |
#symbol_id ⇒ Object
14 15 16 17 |
# File 'lib/docks/containers/function_container.rb', line 14 def symbol_id return super unless method? "method-#{"static-" if static?}#{self[:for]}-#{self[:name]}" end |
#to_descriptor ⇒ Object
19 20 21 22 |
# File 'lib/docks/containers/function_container.rb', line 19 def to_descriptor return super unless method? "#{belongs_to.to_descriptor}#{static? ? "." : "#"}#{fetch(:name)}" end |