Class: Obp::Access::Deliverable
- Inherits:
-
Object
- Object
- Obp::Access::Deliverable
- Defined in:
- lib/obp/access/deliverable.rb
Constant Summary collapse
- TYPE_SEGMENTS =
{ "IS" => nil, "TS" => "ts", "TR" => "tr", "R" => "r", "PAS" => "pas", "ISP" => "isp", "GUIDE" => "guide", "IWA" => "iwa", "DATA" => "data", "TTA" => "tta" }.freeze
- TYPE_WORDS =
Set.new(TYPE_SEGMENTS.compact.keys).freeze
- PUBLISHED_STAGES =
[6060, 9092].freeze
Instance Attribute Summary collapse
-
#current_stage ⇒ Object
readonly
Returns the value of attribute current_stage.
-
#deliverable_type ⇒ Object
readonly
Returns the value of attribute deliverable_type.
-
#edition ⇒ Object
readonly
Returns the value of attribute edition.
-
#ics_codes ⇒ Object
readonly
Returns the value of attribute ics_codes.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#languages ⇒ Object
readonly
Returns the value of attribute languages.
-
#owner_committee ⇒ Object
readonly
Returns the value of attribute owner_committee.
-
#publication_date ⇒ Object
readonly
Returns the value of attribute publication_date.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
-
#supplement_type ⇒ Object
readonly
Returns the value of attribute supplement_type.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #base_document? ⇒ Boolean
- #english_title ⇒ Object
-
#initialize(data) ⇒ Deliverable
constructor
A new instance of Deliverable.
- #published? ⇒ Boolean
- #retrievable? ⇒ Boolean
- #to_urn(language: "en") ⇒ Object
Constructor Details
#initialize(data) ⇒ Deliverable
Returns a new instance of Deliverable.
20 21 22 23 |
# File 'lib/obp/access/deliverable.rb', line 20 def initialize(data) @id = data["id"] (data) end |
Instance Attribute Details
#current_stage ⇒ Object (readonly)
Returns the value of attribute current_stage.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def current_stage @current_stage end |
#deliverable_type ⇒ Object (readonly)
Returns the value of attribute deliverable_type.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def deliverable_type @deliverable_type end |
#edition ⇒ Object (readonly)
Returns the value of attribute edition.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def edition @edition end |
#ics_codes ⇒ Object (readonly)
Returns the value of attribute ics_codes.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def ics_codes @ics_codes end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def id @id end |
#languages ⇒ Object (readonly)
Returns the value of attribute languages.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def languages @languages end |
#owner_committee ⇒ Object (readonly)
Returns the value of attribute owner_committee.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def owner_committee @owner_committee end |
#publication_date ⇒ Object (readonly)
Returns the value of attribute publication_date.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def publication_date @publication_date end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def reference @reference end |
#supplement_type ⇒ Object (readonly)
Returns the value of attribute supplement_type.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def supplement_type @supplement_type end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
16 17 18 |
# File 'lib/obp/access/deliverable.rb', line 16 def title @title end |
Instance Method Details
#base_document? ⇒ Boolean
29 30 31 |
# File 'lib/obp/access/deliverable.rb', line 29 def base_document? supplement_type.nil? end |
#english_title ⇒ Object
41 42 43 |
# File 'lib/obp/access/deliverable.rb', line 41 def english_title title["en"] end |
#published? ⇒ Boolean
25 26 27 |
# File 'lib/obp/access/deliverable.rb', line 25 def published? PUBLISHED_STAGES.include?(current_stage) end |
#retrievable? ⇒ Boolean
33 34 35 |
# File 'lib/obp/access/deliverable.rb', line 33 def retrievable? published? && base_document? && languages.any? end |