Class: ReligioCLI::Trads
- Inherits:
-
Object
- Object
- ReligioCLI::Trads
- Defined in:
- lib/religio_cli/trads.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#name ⇒ Object
Returns the value of attribute name.
-
#quick_facts ⇒ Object
Returns the value of attribute quick_facts.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(religion_hash) ⇒ Trads
constructor
A new instance of Trads.
- #religion_details(religion_hash) ⇒ Object
Constructor Details
#initialize(religion_hash) ⇒ Trads
Returns a new instance of Trads.
5 6 7 8 9 10 |
# File 'lib/religio_cli/trads.rb', line 5 def initialize(religion_hash) @name = religion_hash[:name] @quick_facts = religion_hash[:quick_facts] @url = religion_hash[:url] @@all << self end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
2 3 4 |
# File 'lib/religio_cli/trads.rb', line 2 def description @description end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/religio_cli/trads.rb', line 2 def name @name end |
#quick_facts ⇒ Object
Returns the value of attribute quick_facts.
2 3 4 |
# File 'lib/religio_cli/trads.rb', line 2 def quick_facts @quick_facts end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/religio_cli/trads.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
20 21 22 |
# File 'lib/religio_cli/trads.rb', line 20 def self.all @@all end |
.create_from_array(religion_hash_array) ⇒ Object
12 13 14 |
# File 'lib/religio_cli/trads.rb', line 12 def self.create_from_array(religion_hash_array) religion_hash_array.each {|religion_hash| ReligioCLI::Trads.new(religion_hash)} end |
Instance Method Details
#religion_details(religion_hash) ⇒ Object
16 17 18 |
# File 'lib/religio_cli/trads.rb', line 16 def religion_details(religion_hash) @description = religion_hash[:description] end |