Sha256: f46c2aee1b0344d0c50ea6950208febfd316e8fe7743fbff1bff487e795dea7b
Contents?: true
Size: 862 Bytes
Versions: 2
Compression:
Stored size: 862 Bytes
Contents
module Orias # Dedicated to Orias registrations objects handling # class Registration < Base attr_accessor :raw, :category_name, :status, :subscribed, :registration_date, :collect_funds, :mandators # Initialize an Orias::Registration instance 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 private class << self end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
orias-0.3.0 | lib/orias/registration.rb |
orias-0.2.0 | lib/orias/registration.rb |