Class: ReligioCLI::Trads

Inherits:
Object
  • Object
show all
Defined in:
lib/religio_cli/trads.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#descriptionObject

Returns the value of attribute description.



2
3
4
# File 'lib/religio_cli/trads.rb', line 2

def description
  @description
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/religio_cli/trads.rb', line 2

def name
  @name
end

#quick_factsObject

Returns the value of attribute quick_facts.



2
3
4
# File 'lib/religio_cli/trads.rb', line 2

def quick_facts
  @quick_facts
end

#urlObject

Returns the value of attribute url.



2
3
4
# File 'lib/religio_cli/trads.rb', line 2

def url
  @url
end

Class Method Details

.allObject



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