class Swagger::Data::Info
Constants
- DEFAULT_DESCRIPTION
- DEFAULT_TITLE
- DEFAULT_VERSION
Public Class Methods
new()
click to toggle source
# File lib/ruby-swagger/data/info.rb, line 13 def initialize @title = DEFAULT_TITLE @description = DEFAULT_DESCRIPTION @version = DEFAULT_VERSION end
parse(info)
click to toggle source
# File lib/ruby-swagger/data/info.rb, line 19 def self.parse(info) raise ArgumentError.new('Swagger::Data::Info#parse - info object is nil') unless info Swagger::Data::Info.new.bulk_set(info) end
Public Instance Methods
contact=(new_contact)
click to toggle source
# File lib/ruby-swagger/data/info.rb, line 30 def contact=(new_contact) return nil unless new_contact unless new_contact.is_a?(Swagger::Data::Contact) new_contact = Swagger::Data::Contact.parse(new_contact) end @contact = new_contact end
license=(new_license)
click to toggle source
# File lib/ruby-swagger/data/info.rb, line 40 def license=(new_license) return nil unless new_license unless new_license.is_a?(Swagger::Data::License) new_license = Swagger::Data::License.parse(new_license) end @license = new_license end
title=(new_title)
click to toggle source
# File lib/ruby-swagger/data/info.rb, line 25 def title=(new_title) raise ArgumentError.new('Swagger::Data::Info#title= - title is invalid') if new_title.nil? || new_title.empty? @title = new_title end
valid?()
click to toggle source
# File lib/ruby-swagger/data/info.rb, line 50 def valid? @license.valid? && @contact.valid? end