Class: Picky::Generators::Weights::Stub

Inherits:
Strategy show all
Defined in:
lib/picky/generators/weights/stub.rb

Overview

Is used for runtime-only strategies.

Note: Pretends to be a backend but

does nothing at all.

To override, implement:

* [symbol_or_string] # During runtime.
* weight_for(size)   # During indextime. # Probably never used.

Direct Known Subclasses

Constant, Dynamic

Instance Method Summary collapse

Methods inherited from Strategy

#to_s

Instance Method Details

#[]=(_, _) ⇒ Object

Saves nothing by default.



43
44
45
# File 'lib/picky/generators/weights/stub.rb', line 43

def []= _, _

end

#clearObject

It does not need to be cleared.



31
32
33
# File 'lib/picky/generators/weights/stub.rb', line 31

def clear

end

#delete(_) ⇒ Object

Nothing needs to be deleted from it.



25
26
27
# File 'lib/picky/generators/weights/stub.rb', line 25

def delete _

end

#saved?Boolean

It is not saved, by default.

Returns:

  • (Boolean)


19
20
21
# File 'lib/picky/generators/weights/stub.rb', line 19

def saved?
  false
end

#weight_for(_) ⇒ Object

Returns nil.



37
38
39
# File 'lib/picky/generators/weights/stub.rb', line 37

def weight_for _
  # Nothing.
end