Class: Struct

Inherits:
Object show all
Defined in:
lib/fiveruns/json/add/core.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.fjson_create(object) ⇒ Object



89
90
91
# File 'lib/fiveruns/json/add/core.rb', line 89

def self.fjson_create(object)
  new(*object['v'])
end

Instance Method Details

#to_fjson(*args) ⇒ Object



93
94
95
96
97
98
99
100
# File 'lib/fiveruns/json/add/core.rb', line 93

def to_fjson(*args)
  klass = self.class.name
  klass.empty? and raise Fiveruns::JSON::JSONError, "Only named structs are supported!"
  {
    'json_class' => klass,
    'v'     => values,
  }.to_fjson(*args)
end