Sha256: a3125c0b2eb7e98c25bf9407054150e7cabb668fe23a5657d9afd11f577b5a04

Contents?: true

Size: 512 Bytes

Versions: 17

Compression:

Stored size: 512 Bytes

Contents

class Cistern::Singular
  extend Cistern::Attributes::ClassMethods
  include Cistern::Attributes::InstanceMethods

  attr_accessor :connection

  def inspect
    if Cistern.formatter
      Cistern.formatter.call(self)
    else
      "#<#{self.class}>"
    end
  end

  def initialize(options)
    merge_attributes(options)
    reload
  end

  def reload
    if new_attributes = fetch_attributes
      merge_attributes(new_attributes)
    end
  end

  def fetch_attributes
    raise NotImplementedError
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
cistern-0.12.3 lib/cistern/singular.rb
cistern-0.12.2 lib/cistern/singular.rb
cistern-0.12.1 lib/cistern/singular.rb
cistern-0.11.3 lib/cistern/singular.rb
cistern-0.11.2 lib/cistern/singular.rb
cistern-0.11.1 lib/cistern/singular.rb
cistern-0.11.0 lib/cistern/singular.rb
cistern-0.10.2 lib/cistern/singular.rb
cistern-0.9.2 lib/cistern/singular.rb
cistern-0.9.1 lib/cistern/singular.rb
cistern-0.9.0 lib/cistern/singular.rb
cistern-0.8.0 lib/cistern/singular.rb
cistern-0.7.1 lib/cistern/singular.rb
cistern-0.7.0 lib/cistern/singular.rb
cistern-0.6.0 lib/cistern/singular.rb
cistern-0.5.10 lib/cistern/singular.rb
cistern-0.5.9 lib/cistern/singular.rb