class Mumukit::Service::DocumentArray

Attributes

raw[RW]

Public Class Methods

new(raw, options={}) click to toggle source
# File lib/mumukit/service/document_array.rb, line 8
def initialize(raw, options={})
  @raw = raw
  @default_key = options[:default_key]
end

Public Instance Methods

array_key() click to toggle source
# File lib/mumukit/service/document_array.rb, line 19
def array_key
  @default_key || key
end
as_json(options={}) click to toggle source
# File lib/mumukit/service/document_array.rb, line 13
def as_json(options={})
  {}.tap do |json|
    json[array_key] = raw.as_json(self.options.merge(options))
  end
end
options() click to toggle source
# File lib/mumukit/service/document_array.rb, line 23
def options
  {}
end

Private Instance Methods

key() click to toggle source
# File lib/mumukit/service/document_array.rb, line 29
def key
  :array
end