class Raddocs::ResponseField

Fields of a response

Can have an unknown columns

@example

Parameter.new({
  "name" => "page",
  "description" => "Page number",
  "Type" => "Integer"
})

Attributes

description[R]
name[R]
scope[R]

Public Class Methods

new(attributes) click to toggle source
# File lib/raddocs/models.rb, line 207
def initialize(attributes)
  @attrs = attributes

  @name = attributes.fetch("name")
  @description = attributes.fetch("description")
  @scope = attributes.fetch("scope", nil)
end

Public Instance Methods

[](key) click to toggle source

Allows unknown keys to be accessed @param key [String] @return [Object]

# File lib/raddocs/models.rb, line 223
def [](key)
  @attrs[key]
end
scope?() click to toggle source

@return [Boolean] true if scope is present

# File lib/raddocs/models.rb, line 216
def scope?
  !!@scope
end