Class: LHS::Item
- Includes:
- Create, Destroy, Save, Update, Validation
- Defined in:
- lib/lhs/item.rb,
lib/lhs/concerns/item/save.rb,
lib/lhs/concerns/item/update.rb,
lib/lhs/concerns/item/destroy.rb,
lib/lhs/concerns/item/validation.rb
Overview
An item is a concrete record. It can be part of another proxy like collection.
Defined Under Namespace
Modules: Destroy, Save, Update, Validation
Constant Summary
Constants included from Proxy::Accessors
Proxy::Accessors::BLACKLISTED_KEYWORDS
Instance Attribute Summary
Attributes inherited from Proxy
Instance Method Summary collapse
Methods included from Validation
Methods included from Update
#partial_update, #partial_update!, #update, #update!
Methods included from Save
Methods included from Destroy
Methods inherited from Proxy
#initialize, #load!, #record, #reload!
Methods included from Proxy::Create
Constructor Details
This class inherits a constructor from LHS::Proxy
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &_block) ⇒ Object (protected)
41 42 43 44 |
# File 'lib/lhs/item.rb', line 41 def method_missing(name, *args, &_block) return set(name, args.try(&:first)) if name.to_s[/=$/] get(name, *args) end |
Instance Method Details
#collection? ⇒ Boolean
23 24 25 |
# File 'lib/lhs/item.rb', line 23 def collection? false end |
#item? ⇒ Boolean
27 28 29 |
# File 'lib/lhs/item.rb', line 27 def item? true end |
#respond_to?(sym, include_all = false) ⇒ Boolean
31 32 33 34 35 36 37 |
# File 'lib/lhs/item.rb', line 31 def respond_to?(sym, include_all = false) if sym == :to_ary false else super(sym, include_all) end end |