class Jess::ExtensionAttributes
A Hash-like wrapper around the extension attributes that facilitates easy key/value access.
Public Class Methods
new(json)
click to toggle source
Calls superclass method
# File lib/jess/extension_attributes.rb, line 10 def initialize(json) super @values = json.each_with_object({}) do |attr, hash| hash[attr["name"]] = attr["value"] end @values.freeze end
Public Instance Methods
to_hash()
click to toggle source
Explicitly delegate instead of using def_delegators in order to be compatible with awesome_print. The original Hash#to_hash method is implemented in C, which means it has an arity of -1. This confuses awesome_print.
# File lib/jess/extension_attributes.rb, line 22 def to_hash @values.to_hash end