Class: ConfigOMat::Template
- Inherits:
-
ConfigItem
- Object
- ConfigItem
- ConfigOMat::Template
- Defined in:
- lib/config_o_mat/shared/types.rb
Instance Attribute Summary collapse
-
#dst ⇒ Object
readonly
Returns the value of attribute dst.
-
#src ⇒ Object
readonly
Returns the value of attribute src.
Attributes inherited from ConfigItem
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(opts) ⇒ Template
constructor
A new instance of Template.
- #validate ⇒ Object
Methods inherited from ConfigItem
#==, #error, #errors?, #validate!
Constructor Details
#initialize(opts) ⇒ Template
Returns a new instance of Template.
147 148 149 150 |
# File 'lib/config_o_mat/shared/types.rb', line 147 def initialize(opts) @src = opts[:src] @dst = opts[:dst] end |
Instance Attribute Details
#dst ⇒ Object (readonly)
Returns the value of attribute dst.
145 146 147 |
# File 'lib/config_o_mat/shared/types.rb', line 145 def dst @dst end |
#src ⇒ Object (readonly)
Returns the value of attribute src.
145 146 147 |
# File 'lib/config_o_mat/shared/types.rb', line 145 def src @src end |
Instance Method Details
#eql?(other) ⇒ Boolean
161 162 163 164 165 |
# File 'lib/config_o_mat/shared/types.rb', line 161 def eql?(other) return false if !super(other) return false if other.src != src || other.dst != dst true end |
#hash ⇒ Object
157 158 159 |
# File 'lib/config_o_mat/shared/types.rb', line 157 def hash src.hash ^ dst.hash end |
#validate ⇒ Object
152 153 154 155 |
# File 'lib/config_o_mat/shared/types.rb', line 152 def validate error :src, PRESENCE_ERROR_MSG if @src.nil? || @src.empty? error :dst, PRESENCE_ERROR_MSG if @dst.nil? || @dst.empty? end |