Class: Orias::Registration
Overview
Dedicated to Orias registrations objects handling
Instance Attribute Summary collapse
-
#category_name ⇒ Object
Returns the value of attribute category_name.
-
#collect_funds ⇒ Object
Returns the value of attribute collect_funds.
-
#mandators ⇒ Object
Returns the value of attribute mandators.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#registration_date ⇒ Object
Returns the value of attribute registration_date.
-
#status ⇒ Object
Returns the value of attribute status.
-
#subscribed ⇒ Object
Returns the value of attribute subscribed.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Registration
constructor
Initialize an Orias::Registration instance.
Constructor Details
#initialize(attributes = {}) ⇒ Registration
Initialize an Orias::Registration instance
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/orias/registration.rb', line 9 def initialize(attributes = {}) @raw = attributes @category_name = @raw.dig('categoryName') @status = @raw.dig('status') @subscribed = @status == 'INSCRIT' @registration_date = @raw.dig('registrationDate') @collect_funds = @raw.dig('collectFunds') == 'true' raw_mandators = @raw.dig('mandators', 'mandator') unless raw_mandators.is_a?(Array) raw_mandators = [raw_mandators] end @mandators = raw_mandators.compact.map do |h| Orias::Mandator.new(h) end end |
Instance Attribute Details
#category_name ⇒ Object
Returns the value of attribute category_name.
5 6 7 |
# File 'lib/orias/registration.rb', line 5 def category_name @category_name end |
#collect_funds ⇒ Object
Returns the value of attribute collect_funds.
5 6 7 |
# File 'lib/orias/registration.rb', line 5 def collect_funds @collect_funds end |
#mandators ⇒ Object
Returns the value of attribute mandators.
5 6 7 |
# File 'lib/orias/registration.rb', line 5 def mandators @mandators end |
#raw ⇒ Object
Returns the value of attribute raw.
5 6 7 |
# File 'lib/orias/registration.rb', line 5 def raw @raw end |
#registration_date ⇒ Object
Returns the value of attribute registration_date.
5 6 7 |
# File 'lib/orias/registration.rb', line 5 def registration_date @registration_date end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/orias/registration.rb', line 5 def status @status end |
#subscribed ⇒ Object
Returns the value of attribute subscribed.
5 6 7 |
# File 'lib/orias/registration.rb', line 5 def subscribed @subscribed end |