Class: KDoc::Container
- Inherits:
-
Object
- Object
- KDoc::Container
- Includes:
- BlockProcessor, Datum, Guarded, Taggable, KLog::Logging
- Defined in:
- lib/k_doc/container.rb
Overview
A container acts a base data object for any data that requires tagging such as unique key, type and namespace.
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#owner ⇒ Object
TODO: Owner/Owned need to be in a module and tested.
Attributes included from BlockProcessor
Attributes included from Datum
Attributes included from Taggable
Instance Method Summary collapse
- #debug ⇒ Object
- #default_container_type ⇒ Object
- #default_data_type ⇒ Object
-
#initialize(**opts, &block) ⇒ Container
constructor
A new instance of Container.
- #owned? ⇒ Boolean
Methods included from BlockProcessor
#eval_block, #execute_block, #initialize_block, #run_on_action
Methods included from Datum
#clear_data, #initialize_data, #set_data
Methods included from Guarded
#clear_errors, #error_hash, #error_messages, #errors, #guard, #log_any_messages, #valid?, #warn
Methods included from Taggable
#initialize_tag, #key, #namespace, #project, #tag, #type
Constructor Details
#initialize(**opts, &block) ⇒ Container
Returns a new instance of Container.
22 23 24 25 26 27 28 |
# File 'lib/k_doc/container.rb', line 22 def initialize(**opts, &block) @opts = opts initialize_tag(opts) initialize_data(opts) initialize_block(opts, &block) end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
13 14 15 |
# File 'lib/k_doc/container.rb', line 13 def opts @opts end |
#owner ⇒ Object
TODO: Owner/Owned need to be in a module and tested
16 17 18 |
# File 'lib/k_doc/container.rb', line 16 def owner @owner end |
Instance Method Details
#debug ⇒ Object
38 39 40 41 |
# File 'lib/k_doc/container.rb', line 38 def debug debug_container debug_errors end |
#default_container_type ⇒ Object
30 31 32 |
# File 'lib/k_doc/container.rb', line 30 def default_container_type :container end |
#default_data_type ⇒ Object
34 35 36 |
# File 'lib/k_doc/container.rb', line 34 def default_data_type @default_data_type ||= Hash end |
#owned? ⇒ Boolean
18 19 20 |
# File 'lib/k_doc/container.rb', line 18 def owned? @owner != nil end |