Class: Pubid::Components::Code
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Pubid::Components::Code
- Defined in:
- lib/pubid/components/code.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
Checks equality with another code component.
-
#hash ⇒ Integer
Returns hash code for code component.
- #render(context: nil) ⇒ Object
- #to_s ⇒ Object
Instance Method Details
#eql?(other) ⇒ Boolean
Checks equality with another code component
26 27 28 29 30 |
# File 'lib/pubid/components/code.rb', line 26 def eql?(other) return false unless other.is_a?(self.class) value == other.value end |
#hash ⇒ Integer
Note:
Memoized for performance
Returns hash code for code component
19 20 21 |
# File 'lib/pubid/components/code.rb', line 19 def hash @hash ||= value.hash end |
#render(context: nil) ⇒ Object
12 13 14 |
# File 'lib/pubid/components/code.rb', line 12 def render(context: nil) value.to_s end |
#to_s ⇒ Object
8 9 10 |
# File 'lib/pubid/components/code.rb', line 8 def to_s value.to_s end |