class CRStruct::Registered
Public Class Methods
new(h, *keys)
click to toggle source
Registered.new
:a, :b, :c, :d Registered.new
{a: 1, b: 2}, :c, :d Registered.new
{a: 1, b: 2}, [:c, :d] (*keys).flatten! should result to an Array(Symbol)
Calls superclass method
CRStruct::Open::new
# File lib/crstruct/registered.rb, line 7 def initialize(h, *keys) keys.flatten! if h.is_a? Symbol keys.unshift(h) h = {} end @r = keys super(h) end
Public Instance Methods
free?(k)
click to toggle source
Calls superclass method
CRStruct::Open#free?
# File lib/crstruct/registered.rb, line 17 def free?(k) return false unless @r.include? k super(k) end