Class: Dao::Params
Constant Summary
Constants included from Validations
Validations::ClassMethods, Validations::InstanceMethods
Instance Attribute Summary collapse
-
#form ⇒ Object
Returns the value of attribute form.
-
#path ⇒ Object
instance methods.
-
#route ⇒ Object
Returns the value of attribute route.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(*args, &block) ⇒ Params
constructor
A new instance of Params.
-
#inspect ⇒ Object
look good for inspect.
- #update(*args, &block) ⇒ Object
Methods included from Validations
Constructor Details
#initialize(*args, &block) ⇒ Params
Returns a new instance of Params.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dao/params.rb', line 19 def initialize(*args, &block) = Dao.(args) @path = args.shift || [:path] || Path.default @route = [:route] || Route.default @form = [:form] || Form.for(self) update([:params]) if [:params] super end |
Instance Attribute Details
#form ⇒ Object
Returns the value of attribute form.
17 18 19 |
# File 'lib/dao/params.rb', line 17 def form @form end |
#path ⇒ Object
instance methods
15 16 17 |
# File 'lib/dao/params.rb', line 15 def path @path end |
#route ⇒ Object
Returns the value of attribute route.
16 17 18 |
# File 'lib/dao/params.rb', line 16 def route @route end |
Instance Method Details
#attributes ⇒ Object
31 32 33 |
# File 'lib/dao/params.rb', line 31 def attributes self end |
#inspect ⇒ Object
look good for inspect
39 40 41 |
# File 'lib/dao/params.rb', line 39 def inspect Dao.json_for(self) end |
#update(*args, &block) ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/dao/params.rb', line 48 def update(*args, &block) if args.size==1 and args.first.respond_to?(:to_dao) to_dao = args.first.to_dao return super(to_dao) end super end |