Class: WsCee::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/ws_cee_client/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_hash) ⇒ Document

Returns a new instance of Document.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ws_cee_client/document.rb', line 14

def initialize(document_hash)
  @type = document_hash[:type]
  @description = document_hash[:description]
  @executor_company = document_hash[:executor_company]
  @court = document_hash[:court]
  @reference_number = document_hash[:reference_number]
  @issue_date = document_hash[:issue_date]
  @one_time_price = document_hash[:one_time_price]
  @regular_price = document_hash[:regular_price]
  @non_monetary = document_hash[:non_monetary]

  @subjects = []
  parse_subject document_hash[:subject]
rescue NoMethodError
  raise WsCee::ParsingError
end

Instance Attribute Details

#courtObject (readonly)

Returns the value of attribute court.



6
7
8
# File 'lib/ws_cee_client/document.rb', line 6

def court
  @court
end

#descriptionObject (readonly)

Returns the value of attribute description.



4
5
6
# File 'lib/ws_cee_client/document.rb', line 4

def description
  @description
end

#executor_companyObject (readonly)

Returns the value of attribute executor_company.



5
6
7
# File 'lib/ws_cee_client/document.rb', line 5

def executor_company
  @executor_company
end

#issue_dateObject (readonly)

Returns the value of attribute issue_date.



8
9
10
# File 'lib/ws_cee_client/document.rb', line 8

def issue_date
  @issue_date
end

#non_monetaryObject (readonly)

Returns the value of attribute non_monetary.



11
12
13
# File 'lib/ws_cee_client/document.rb', line 11

def non_monetary
  @non_monetary
end

#one_time_priceObject (readonly)

Returns the value of attribute one_time_price.



9
10
11
# File 'lib/ws_cee_client/document.rb', line 9

def one_time_price
  @one_time_price
end

#reference_numberObject (readonly)

Returns the value of attribute reference_number.



7
8
9
# File 'lib/ws_cee_client/document.rb', line 7

def reference_number
  @reference_number
end

#regular_priceObject (readonly)

Returns the value of attribute regular_price.



10
11
12
# File 'lib/ws_cee_client/document.rb', line 10

def regular_price
  @regular_price
end

#subjectsObject (readonly)

Returns the value of attribute subjects.



12
13
14
# File 'lib/ws_cee_client/document.rb', line 12

def subjects
  @subjects
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/ws_cee_client/document.rb', line 3

def type
  @type
end