Sha256: 936cb931f5167a023107fbacb1d85bd9e09d01a1ae1e37b20474ef6604f10ac6

Contents?: true

Size: 405 Bytes

Versions: 18

Compression:

Stored size: 405 Bytes

Contents

module WithExpectations
  extend ActiveSupport::Concern

  included do
    serialize :expectations
  end

  def expectations_yaml
    self.expectations.to_yaml
  end

  def expectations_yaml=(yaml)
    self.expectations = YAML.load yaml
  end

  def expectations=(expectations)
    self[:expectations] = expectations.map(&:stringify_keys)
  end

  def expectations
    self[:expectations] || []
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
mumuki-laboratory-5.3.0 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.2.1 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.2.0 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.1.1 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.1.0 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.12 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.11 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.10 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.9 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.8 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.7 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.6 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.5 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.4 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.3 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.2 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.1 app/models/concerns/with_expectations.rb
mumuki-laboratory-5.0.0 app/models/concerns/with_expectations.rb