class Qubell::Base

Class wrapper for HTTP requests

Attributes

id[R]

@return [String] object id

name[R]

@return [String] object name

Public Class Methods

new(args) click to toggle source
# File lib/qubell/base.rb, line 18
def initialize(args)
  @id = if args[:id].nil?
          raise ArgumentError,
                "can't initialize #{self.class.name} without id"
        else
          args[:id]
        end
  @name = args[:name]
end

Public Instance Methods

==(other) click to toggle source
# File lib/qubell/base.rb, line 40
def ==(other)
  other.instance_of?(self.class) && id == other.id && name == other.name
end
to_hash() click to toggle source
# File lib/qubell/base.rb, line 36
def to_hash
  { id: @id, name: @name }
end
to_json(options) click to toggle source
# File lib/qubell/base.rb, line 28
def to_json(options)
  to_hash.to_json(options)
end
to_s() click to toggle source
# File lib/qubell/base.rb, line 32
def to_s
  %("id": "#{@id}", "name": "#{@name}")
end