Class: Pakyow::Data::Sources::Base
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Pakyow::Data::Sources::Base
- Extended by:
- Support::ClassState
- Defined in:
- lib/pakyow/data/sources/base.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.container ⇒ Object
Returns the value of attribute container.
Instance Attribute Summary collapse
- #original_results ⇒ Object readonly private
Class Method Summary collapse
- .instance ⇒ Object private
- .plural_name ⇒ Object private
- .singular_name ⇒ Object private
- .source_from_source(source, dataset) ⇒ Object private
Instance Method Summary collapse
- #command?(_maybe_command_name) ⇒ Boolean private
-
#initialize(dataset) ⇒ Base
constructor
A new instance of Base.
- #modifier?(_maybe_modifier_name) ⇒ Boolean private
-
#pp(*args) ⇒ Object
Fixes an issue using pp inside a delegator.
- #qualifications ⇒ Object private
- #query?(_maybe_query_name) ⇒ Boolean private
- #source_from_self(dataset = __getobj__) ⇒ Object private
Constructor Details
#initialize(dataset) ⇒ Base
Returns a new instance of Base.
14 15 16 |
# File 'lib/pakyow/data/sources/base.rb', line 14 def initialize(dataset) __setobj__(dataset) end |
Class Attribute Details
.container ⇒ Object
Returns the value of attribute container.
53 54 55 |
# File 'lib/pakyow/data/sources/base.rb', line 53 def container @container end |
Instance Attribute Details
#original_results ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/pakyow/data/sources/base.rb', line 25 def original_results @original_results end |
Class Method Details
.instance ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
56 57 58 |
# File 'lib/pakyow/data/sources/base.rb', line 56 def instance container.source(plural_name) end |
.plural_name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
64 65 66 |
# File 'lib/pakyow/data/sources/base.rb', line 64 def plural_name Support.inflector.pluralize(__object_name.name).to_sym end |
.singular_name ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
69 70 71 |
# File 'lib/pakyow/data/sources/base.rb', line 69 def singular_name Support.inflector.singularize(__object_name.name).to_sym end |
.source_from_source(source, dataset) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
74 75 76 77 78 |
# File 'lib/pakyow/data/sources/base.rb', line 74 def source_from_source(source, dataset) source.dup.tap do |duped_source| duped_source.__setobj__(dataset) end end |
Instance Method Details
#command?(_maybe_command_name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/pakyow/data/sources/base.rb', line 33 def command?(_maybe_command_name) false end |
#modifier?(_maybe_modifier_name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
43 44 45 |
# File 'lib/pakyow/data/sources/base.rb', line 43 def modifier?(_maybe_modifier_name) false end |
#pp(*args) ⇒ Object
Fixes an issue using pp inside a delegator.
20 21 22 |
# File 'lib/pakyow/data/sources/base.rb', line 20 def pp(*args) Kernel.pp(*args) end |
#qualifications ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 |
# File 'lib/pakyow/data/sources/base.rb', line 28 def qualifications {} end |
#query?(_maybe_query_name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/pakyow/data/sources/base.rb', line 38 def query?(_maybe_query_name) false end |
#source_from_self(dataset = __getobj__) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
48 49 50 |
# File 'lib/pakyow/data/sources/base.rb', line 48 def source_from_self(dataset = __getobj__) self.class.source_from_source(self, dataset) end |