Sha256: 971a7e8f219991d2fbc48e599880cc6e4fe6027ea0508eb17f0cfbf405bea6bd
Contents?: true
Size: 883 Bytes
Versions: 1
Compression:
Stored size: 883 Bytes
Contents
# frozen_string_literal: true require_relative 'view' module Scenic module Cascade # Represents a view dependency class Dependency attr_reader :from, :to def initialize(from:, to:) raise TypeError unless from.is_a?(Scenic::Cascade::View) raise TypeError unless to.is_a?(Scenic::Cascade::View) @from = from @to = to end def ==(other) from == other.from && to == other.to end # mermaid-like syntax def to_s "#{from.name}[#{from}] --> #{to.name}[#{to}]" end alias inspect to_s def self.from_hash(hash) from = Scenic::Cascade::View.new(name: hash['from'], materialized: hash['from_materialized']) to = Scenic::Cascade::View.new(name: hash['to'], materialized: hash['to_materialized']) new(from: from, to: to) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
scenic-cascade-0.1.0 | lib/scenic/cascade/dependency.rb |