Class: Verso::Occupation
- Includes:
- HTTPGettable, Sluggable
- Defined in:
- lib/verso/occupation.rb
Overview
Occupation resource
An occupation is contained by a Pathway
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
HTML-formatted Occupation description.
-
#id ⇒ Fixnum
readonly
Occupation ID.
-
#preparations ⇒ Array
readonly
Collection of preparation titles (strings).
-
#title ⇒ String
readonly
Occupation title.
Attributes inherited from Base
Instance Method Summary collapse
-
#pathway ⇒ Verso::Pathway
Pathway that is the parent of this occupation.
-
#related_courses ⇒ Array
Collection of related Course objects.
Methods included from Sluggable
Methods inherited from Base
Constructor Details
This class inherits a constructor from Verso::Base
Instance Attribute Details
#description ⇒ String (readonly)
Returns HTML-formatted Occupation description.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/verso/occupation.rb', line 22 class Occupation < Verso::Base include HTTPGettable include Sluggable attr_reader :description, :id, :preparations, :title # @return [Verso::Pathway] Pathway that is the parent of this occupation def pathway @pathway ||= Pathway.new(get_attr(:pathway)) end # @return [Array] Collection of related {Verso::Course} objects def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end private def fetch super[:occupation] end def path "/occupations/#{id}" end end |
#id ⇒ Fixnum (readonly)
Returns Occupation ID.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/verso/occupation.rb', line 22 class Occupation < Verso::Base include HTTPGettable include Sluggable attr_reader :description, :id, :preparations, :title # @return [Verso::Pathway] Pathway that is the parent of this occupation def pathway @pathway ||= Pathway.new(get_attr(:pathway)) end # @return [Array] Collection of related {Verso::Course} objects def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end private def fetch super[:occupation] end def path "/occupations/#{id}" end end |
#preparations ⇒ Array (readonly)
Returns Collection of preparation titles (strings).
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/verso/occupation.rb', line 22 class Occupation < Verso::Base include HTTPGettable include Sluggable attr_reader :description, :id, :preparations, :title # @return [Verso::Pathway] Pathway that is the parent of this occupation def pathway @pathway ||= Pathway.new(get_attr(:pathway)) end # @return [Array] Collection of related {Verso::Course} objects def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end private def fetch super[:occupation] end def path "/occupations/#{id}" end end |
#title ⇒ String (readonly)
Returns Occupation title.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/verso/occupation.rb', line 22 class Occupation < Verso::Base include HTTPGettable include Sluggable attr_reader :description, :id, :preparations, :title # @return [Verso::Pathway] Pathway that is the parent of this occupation def pathway @pathway ||= Pathway.new(get_attr(:pathway)) end # @return [Array] Collection of related {Verso::Course} objects def @related_courses ||= get_attr(:related_courses). collect { |c| Course.new(c) } end private def fetch super[:occupation] end def path "/occupations/#{id}" end end |
Instance Method Details
#pathway ⇒ Verso::Pathway
Returns Pathway that is the parent of this occupation.
28 29 30 |
# File 'lib/verso/occupation.rb', line 28 def pathway @pathway ||= Pathway.new(get_attr(:pathway)) end |