Class: Verso::Pathway
- Includes:
- HTTPGettable, Sluggable
- Defined in:
- lib/verso/pathway.rb
Overview
Pathway Resource
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
HTML-formatted Pathway description.
-
#id ⇒ Fixnum
readonly
Pathway id.
-
#title ⇒ String
readonly
Pathway title.
Attributes inherited from Base
Instance Method Summary collapse
-
#cluster ⇒ Verso::Cluster
Parent Cluster.
-
#occupations ⇒ Array
Children Occupation 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 Pathway description.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/verso/pathway.rb', line 18 class Pathway < Verso::Base include HTTPGettable include Sluggable attr_reader :description, :id, :title # @return [Verso::Cluster] Parent Cluster def cluster @cluster ||= Cluster.new(get_attr(:cluster)) end # @return [Array] Children {Verso::Occupation} objects def occupations @occupations ||= get_attr(:occupations). collect { |o| Occupation.new(o) } end private def fetch super[:pathway] end def path "/pathways/#{id}" end end |
#id ⇒ Fixnum (readonly)
Returns Pathway id.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/verso/pathway.rb', line 18 class Pathway < Verso::Base include HTTPGettable include Sluggable attr_reader :description, :id, :title # @return [Verso::Cluster] Parent Cluster def cluster @cluster ||= Cluster.new(get_attr(:cluster)) end # @return [Array] Children {Verso::Occupation} objects def occupations @occupations ||= get_attr(:occupations). collect { |o| Occupation.new(o) } end private def fetch super[:pathway] end def path "/pathways/#{id}" end end |
#title ⇒ String (readonly)
Returns Pathway title.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/verso/pathway.rb', line 18 class Pathway < Verso::Base include HTTPGettable include Sluggable attr_reader :description, :id, :title # @return [Verso::Cluster] Parent Cluster def cluster @cluster ||= Cluster.new(get_attr(:cluster)) end # @return [Array] Children {Verso::Occupation} objects def occupations @occupations ||= get_attr(:occupations). collect { |o| Occupation.new(o) } end private def fetch super[:pathway] end def path "/pathways/#{id}" end end |
Instance Method Details
#cluster ⇒ Verso::Cluster
Returns Parent Cluster.
24 25 26 |
# File 'lib/verso/pathway.rb', line 24 def cluster @cluster ||= Cluster.new(get_attr(:cluster)) end |
#occupations ⇒ Array
Returns Children Occupation objects.
29 30 31 32 |
# File 'lib/verso/pathway.rb', line 29 def occupations @occupations ||= get_attr(:occupations). collect { |o| Occupation.new(o) } end |