Class: EtdaUtilities::Partner
- Inherits:
-
Object
- Object
- EtdaUtilities::Partner
- Defined in:
- lib/etda_utilities/partner.rb
Constant Summary collapse
- VALID_IDS =
%w[graduate honors milsch sset].freeze
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #committee_label ⇒ Object
- #committee_list_label ⇒ Object
- #email_address ⇒ Object
- #email_list ⇒ Object
- #graduate? ⇒ Boolean
- #header_title ⇒ Object
- #honors? ⇒ Boolean
-
#initialize(id) ⇒ Partner
constructor
A new instance of Partner.
- #milsch? ⇒ Boolean
- #name ⇒ Object
- #program_label ⇒ Object
- #slug ⇒ Object
- #sset? ⇒ Boolean
Constructor Details
#initialize(id) ⇒ Partner
Returns a new instance of Partner.
11 12 13 14 15 16 17 |
# File 'lib/etda_utilities/partner.rb', line 11 def initialize(id) unless VALID_IDS.include?(id) raise ArgumentError, "Unknown partner id #{id.inspect}" end @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
19 20 21 |
# File 'lib/etda_utilities/partner.rb', line 19 def id @id end |
Class Method Details
.current ⇒ Object
7 8 9 |
# File 'lib/etda_utilities/partner.rb', line 7 def self.current new(ENV.fetch('PARTNER')) end |
Instance Method Details
#committee_label ⇒ Object
41 42 43 |
# File 'lib/etda_utilities/partner.rb', line 41 def committee_label attributes['committee']['label'] end |
#committee_list_label ⇒ Object
45 46 47 |
# File 'lib/etda_utilities/partner.rb', line 45 def committee_list_label attributes['committee']['list']['label'] end |
#email_address ⇒ Object
25 26 27 |
# File 'lib/etda_utilities/partner.rb', line 25 def email_address attributes['email']['address'] end |
#email_list ⇒ Object
21 22 23 |
# File 'lib/etda_utilities/partner.rb', line 21 def email_list attributes['email']['list'] end |
#graduate? ⇒ Boolean
53 54 55 |
# File 'lib/etda_utilities/partner.rb', line 53 def graduate? id == 'graduate' end |
#header_title ⇒ Object
49 50 51 |
# File 'lib/etda_utilities/partner.rb', line 49 def header_title attributes['header_title'] end |
#honors? ⇒ Boolean
57 58 59 |
# File 'lib/etda_utilities/partner.rb', line 57 def honors? id == 'honors' end |
#milsch? ⇒ Boolean
61 62 63 |
# File 'lib/etda_utilities/partner.rb', line 61 def milsch? id == 'milsch' end |
#name ⇒ Object
29 30 31 |
# File 'lib/etda_utilities/partner.rb', line 29 def name attributes['name'] end |
#program_label ⇒ Object
37 38 39 |
# File 'lib/etda_utilities/partner.rb', line 37 def program_label attributes['program']['label'] end |
#slug ⇒ Object
33 34 35 |
# File 'lib/etda_utilities/partner.rb', line 33 def slug attributes['slug'] end |
#sset? ⇒ Boolean
65 66 67 |
# File 'lib/etda_utilities/partner.rb', line 65 def sset? id == 'sset' end |