class Redd::Objects::Base

A base for all objects to inherit from.

Attributes

client[R]

@!attribute [r] client @return [Clients::Base] The client that used to make requests.

Public Class Methods

alias_property(new_name, old_name) click to toggle source

Define an alias for a property. @param [Symbol] new_name The alias. @param [Symbol] old_name The existing property.

# File lib/redd/objects/base.rb, line 33
def self.alias_property(new_name, old_name)
  define_method(new_name) { send(old_name) }
  define_method(:"#{new_name}?") { send(old_name) }
end
new(client, attributes = {}) click to toggle source

@param [Clients::Base] client The client instance. @param [Hash] attributes A hash of attributes.

Calls superclass method
# File lib/redd/objects/base.rb, line 25
def initialize(client, attributes = {})
  @client = client
  super(attributes)
end