Class: Functional::Save
Instance Attribute Summary collapse
-
#db ⇒ Object
readonly
Returns the value of attribute db.
Attributes inherited from Base
Instance Method Summary collapse
- #call(k, *v) ⇒ Object
-
#initialize(db) ⇒ Save
constructor
A new instance of Save.
Methods inherited from Base
#base_fun, #clean, #end, #to_proc
Constructor Details
#initialize(db) ⇒ Save
Returns a new instance of Save.
453 454 455 |
# File 'lib/functional.rb', line 453 def initialize db @db = db end |
Instance Attribute Details
#db ⇒ Object (readonly)
Returns the value of attribute db.
451 452 453 |
# File 'lib/functional.rb', line 451 def db @db end |
Instance Method Details
#call(k, *v) ⇒ Object
457 458 459 |
# File 'lib/functional.rb', line 457 def call k, *v @db[ k] = v.length == 1 ? v.first : v end |