Class: Scenic::Cascade::ViewWithVersion
- Defined in:
- lib/scenic/cascade/view_with_version.rb
Overview
Represents a view with version
Instance Attribute Summary collapse
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Attributes inherited from View
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name:, version:, materialized:) ⇒ ViewWithVersion
constructor
A new instance of ViewWithVersion.
- #to_s ⇒ Object (also: #inspect)
Methods inherited from View
#formatted_name, #materialized?
Constructor Details
#initialize(name:, version:, materialized:) ⇒ ViewWithVersion
Returns a new instance of ViewWithVersion.
9 10 11 12 13 14 15 |
# File 'lib/scenic/cascade/view_with_version.rb', line 9 def initialize(name:, version:, materialized:) super(name: name, materialized: materialized) raise TypeError unless version.is_a?(Integer) @version = version end |
Instance Attribute Details
#version ⇒ Object (readonly)
Returns the value of attribute version.
7 8 9 |
# File 'lib/scenic/cascade/view_with_version.rb', line 7 def version @version end |
Instance Method Details
#==(other) ⇒ Object
17 18 19 |
# File 'lib/scenic/cascade/view_with_version.rb', line 17 def ==(other) name == other.name && version == other.version && materialized? == other.materialized? end |
#to_s ⇒ Object Also known as: inspect
21 22 23 |
# File 'lib/scenic/cascade/view_with_version.rb', line 21 def to_s "#{name}_v#{formatted_version} (#{materialized? ? 'MV' : 'V'})" end |