class DHS::Item
An item is a concrete record. It can be part of another proxy like collection.
Public Instance Methods
collection?()
click to toggle source
# File lib/dhs/item.rb, line 25 def collection? false end
item?()
click to toggle source
# File lib/dhs/item.rb, line 29 def item? true end
respond_to?(sym, include_all = false)
click to toggle source
Calls superclass method
# File lib/dhs/item.rb, line 33 def respond_to?(sym, include_all = false) if sym == :to_ary false else super(sym, include_all) end end
Protected Instance Methods
method_missing(name, *args, **_keyword_args, &_block)
click to toggle source
# File lib/dhs/item.rb, line 43 def method_missing(name, *args, **_keyword_args, &_block) return set(name, args) if name.to_s[/=$/] get(name, *args) end
respond_to_missing?(name, _include_all = false)
click to toggle source
# File lib/dhs/item.rb, line 48 def respond_to_missing?(name, _include_all = false) # We accept every message that does not belong to set of keywords !BLACKLISTED_KEYWORDS.include?(name.to_s) end
unwrap_nested_item()
click to toggle source
# File lib/dhs/item.rb, line 53 def unwrap_nested_item return _data unless _record.item_key nested_data = _data.dig(*_record.item_key) return _data unless nested_data DHS::Data.new(nested_data, _data._parent, _record, _data._request, _data._endpoint) end