Class: Stash::Wrapper::Embargo
- Inherits:
-
Object
- Object
- Stash::Wrapper::Embargo
- Includes:
- XML::Mapping
- Defined in:
- lib/stash/wrapper/embargo.rb
Overview
Mapping class for <st:embargo>
Class Method Summary collapse
-
.none ⇒ Embargo
Creates a new
Embargoinstance of type EmbargoType::NONE with the current date as start and end.
Instance Method Summary collapse
-
#initialize(type:, period:, start_date:, end_date:) ⇒ Embargo
constructor
Creates a new Embargo object.
Constructor Details
#initialize(type:, period:, start_date:, end_date:) ⇒ Embargo
Creates a new Stash::Wrapper::Embargo object
21 22 23 24 25 26 |
# File 'lib/stash/wrapper/embargo.rb', line 21 def initialize(type:, period:, start_date:, end_date:) self.type = type self.period = period self.start_date = start_date self.end_date = end_date end |
Class Method Details
.none ⇒ Embargo
Creates a new Embargo instance of type EmbargoType::NONE with the current date as start and end.
30 31 32 33 |
# File 'lib/stash/wrapper/embargo.rb', line 30 def self.none today = Date.today new(type: ::NONE, period: ::NONE.value, start_date: today, end_date: today) end |