Sha256: 79b1194852ab37b49a5c9d1042ae5a16e78c46798dc1cf51de6886c1feb4223e

Contents?: true

Size: 509 Bytes

Versions: 15

Compression:

Stored size: 509 Bytes

Contents

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

  attr_accessor :service

  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

15 entries across 15 versions & 1 rubygems

Version Path
cistern-2.2.1 lib/cistern/singular.rb
cistern-2.1.0 lib/cistern/singular.rb
cistern-2.0.5 lib/cistern/singular.rb
cistern-2.0.4 lib/cistern/singular.rb
cistern-2.0.3 lib/cistern/singular.rb
cistern-2.0.2 lib/cistern/singular.rb
cistern-2.0.1 lib/cistern/singular.rb
cistern-1.0.1.pre6 lib/cistern/singular.rb
cistern-1.0.1.pre5 lib/cistern/singular.rb
cistern-1.0.1.pre4 lib/cistern/singular.rb
cistern-1.0.1.pre3 lib/cistern/singular.rb
cistern-1.0.1.pre2 lib/cistern/singular.rb
cistern-1.0.1.pre1 lib/cistern/singular.rb
cistern-1.0.0.pre lib/cistern/singular.rb
cistern-0.11.2.pre2 lib/cistern/singular.rb