Class: Docks::Containers::Klass

Inherits:
Symbol show all
Defined in:
lib/docks/containers/class_container.rb

Overview

Public: a container for Class symbols.

Direct Known Subclasses

Factory

Instance Attribute Summary

Attributes inherited from Symbol

#belongs_to, #methods, #properties

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Symbol

#add_members, #find, from_symbol, #has_members?, #initialize, #member?, #members, #private?, #public?, #summary, #symbol_id, #to_descriptor

Methods inherited from Base

#==, #[], #[]=, #delete, #fetch, #find, #initialize, #method_missing, #respond_to?, #summarized?, #summary, #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

.typeObject

Public: the type of symbols that should be encapsulated by this container. This is compared against a symbol’s ‘symbol_type` to determine which container to use.

Returns the type String.



15
# File 'lib/docks/containers/class_container.rb', line 15

def self.type; Docks::Types::Symbol::CLASS end

Instance Method Details

#add_member(symbol) ⇒ Object



32
33
34
35
36
# File 'lib/docks/containers/class_container.rb', line 32

def add_member(symbol)
  static = symbol.static?
  super
  symbol.static = static
end

#instance_membersObject



29
# File 'lib/docks/containers/class_container.rb', line 29

def instance_members; instance_methods + instance_properties end

#instance_methodsObject



21
# File 'lib/docks/containers/class_container.rb', line 21

def instance_methods; methods.reject { |meth| meth.static? } end

#instance_propertiesObject



27
# File 'lib/docks/containers/class_container.rb', line 27

def instance_properties; properties.reject { |prop| prop.static? } end

#private_methodsObject



18
# File 'lib/docks/containers/class_container.rb', line 18

def private_methods; methods.select { |meth| meth.private? } end

#private_propertiesObject



24
# File 'lib/docks/containers/class_container.rb', line 24

def private_properties; properties.select { |prop| prop.private? } end

#public_methodsObject



17
# File 'lib/docks/containers/class_container.rb', line 17

def public_methods; methods.select { |meth| meth.public? } end

#public_propertiesObject



23
# File 'lib/docks/containers/class_container.rb', line 23

def public_properties; properties.select { |prop| prop.public? } end

#static_membersObject



30
# File 'lib/docks/containers/class_container.rb', line 30

def static_members; static_methods + static_properties end

#static_methodsObject



20
# File 'lib/docks/containers/class_container.rb', line 20

def static_methods; methods.select { |meth| meth.static? } end

#static_propertiesObject



26
# File 'lib/docks/containers/class_container.rb', line 26

def static_properties; properties.select { |prop| prop.static? } end