Class: Pubid::Itu::Identifier::Supplement
- Defined in:
- lib/pubid/itu/identifier/supplement.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
Attributes inherited from Base
#amendment, #annex, #date, #range, #second_number, #sector, #series, #subseries
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(base: nil, **opts) ⇒ Supplement
constructor
A new instance of Supplement.
- #to_h(deep: false) ⇒ Object
Methods inherited from Base
get_parser_class, get_renderer_class, get_transformer_class, has_type?, #to_s, transform, transform_supplements
Constructor Details
#initialize(base: nil, **opts) ⇒ Supplement
Returns a new instance of Supplement.
8 9 10 11 |
# File 'lib/pubid/itu/identifier/supplement.rb', line 8 def initialize(base: nil, **opts) super(**opts) @base = base end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
6 7 8 |
# File 'lib/pubid/itu/identifier/supplement.rb', line 6 def base @base end |
Class Method Details
.type ⇒ Object
19 20 21 |
# File 'lib/pubid/itu/identifier/supplement.rb', line 19 def self.type { key: :supplement, title: "Supplement" } end |
Instance Method Details
#to_h(deep: false) ⇒ Object
13 14 15 16 17 |
# File 'lib/pubid/itu/identifier/supplement.rb', line 13 def to_h(deep: false) # XXX: hack to render supplements using Base renderer, because we need to # place date published after amendment, e.g. `ITU-T G.780/Y.1351 Amd 1 (2004)` @base.to_h(deep: deep).merge(self.type[:key] => super) end |