Class: Pakyow::Data::Sources::Base

Inherits:
SimpleDelegator
  • Object
show all
Extended by:
Support::ClassState
Defined in:
lib/pakyow/data/sources/base.rb

Direct Known Subclasses

Ephemeral, Relational

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

.containerObject

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_resultsObject (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

.instanceObject

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_nameObject

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_nameObject

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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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

#qualificationsObject

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.

Returns:

  • (Boolean)


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