Sha256: 73faa39f6517b7a67a6bde9b4c04bea0ae3ccaebf566a454ec379a22247d2409

Contents?: true

Size: 251 Bytes

Versions: 11

Compression:

Stored size: 251 Bytes

Contents

require 'active_support'

class LHS::Data

  module Becomes
    extend ActiveSupport::Concern

    def becomes(klass)
      return self if self.class == klass && !is_a?(LHS::Data)
      klass.new(LHS::Data.new(_raw, _parent, klass))
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lhs-16.1.3 lib/lhs/concerns/data/becomes.rb
lhs-16.1.2 lib/lhs/concerns/data/becomes.rb
lhs-16.1.1 lib/lhs/concerns/data/becomes.rb
lhs-16.1.0 lib/lhs/concerns/data/becomes.rb
lhs-16.0.1 lib/lhs/concerns/data/becomes.rb
lhs-16.0.0 lib/lhs/concerns/data/becomes.rb
lhs-15.7.0 lib/lhs/concerns/data/becomes.rb
lhs-15.6.1 lib/lhs/concerns/data/becomes.rb
lhs-15.6.0 lib/lhs/concerns/data/becomes.rb
lhs-15.5.1 lib/lhs/concerns/data/becomes.rb
lhs-15.5.0 lib/lhs/concerns/data/becomes.rb