Sha256: b960370ba93e2de1a960498c42cd7b8d0f3650c1c782d68f55376ae5d9375eba
Contents?: true
Size: 874 Bytes
Versions: 21
Compression:
Stored size: 874 Bytes
Contents
module Apipie class ErrorDescription attr_reader :code, :description, :metadata def self.from_dsl_data(args) code_or_options, desc, options = args Apipie::ErrorDescription.new(code_or_options, desc, options) end def initialize(code_or_options, desc=nil, options={}) if code_or_options.is_a? Hash code_or_options.symbolize_keys! @code = code_or_options[:code] @metadata = code_or_options[:meta] @description = code_or_options[:desc] || code_or_options[:description] else @code = code_or_options @metadata = options[:meta] @description = desc end end def to_json { :code => code, :description => description, :metadata => metadata } end end end
Version data entries
21 entries across 21 versions & 1 rubygems