Class: Shep::EntityBox

Inherits:
OnDemandTypeBox show all
Defined in:
lib/shep/typeboxes.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OnDemandTypeBox

#element_klass, wrapping

Methods inherited from TypeBox

#==, #get, #initialize, #inspect, #set, #set?, #to_s, #unset?

Constructor Details

This class inherits a constructor from Shep::TypeBox

Class Method Details

.to_yard_sObject



170
# File 'lib/shep/typeboxes.rb', line 170

def self.to_yard_s = self.element_klass.to_s.gsub(/^Shep::/,'')

Instance Method Details

#check(v) ⇒ Object



168
# File 'lib/shep/typeboxes.rb', line 168

def check(v) = assert_type(v, self.element_klass)

#get_for_jsonObject



172
# File 'lib/shep/typeboxes.rb', line 172

def get_for_json = @value ? @value.to_h(true) : @value

#set_from_json(jhash) ⇒ Object



174
175
176
177
# File 'lib/shep/typeboxes.rb', line 174

def set_from_json(jhash)
  return set(nil) if jhash == nil
  set(self.element_klass.from(jhash))
end