Class: Ehpt::GetProject
Instance Attribute Summary collapse
-
#project_id ⇒ Object
readonly
Returns the value of attribute project_id.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(token, project_id) ⇒ GetProject
constructor
A new instance of GetProject.
Methods inherited from Base
Constructor Details
#initialize(token, project_id) ⇒ GetProject
Returns a new instance of GetProject.
8 9 10 11 12 |
# File 'lib/ehpt/get_project.rb', line 8 def initialize(token, project_id) @token = token || ENV['PIVOTAL_TRACKER_TOKEN'] @project_id = project_id || ENV['PIVOTAL_TRACKER_PROJECT_ID'] super end |
Instance Attribute Details
#project_id ⇒ Object (readonly)
Returns the value of attribute project_id.
6 7 8 |
# File 'lib/ehpt/get_project.rb', line 6 def project_id @project_id end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
6 7 8 |
# File 'lib/ehpt/get_project.rb', line 6 def token @token end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 |
# File 'lib/ehpt/get_project.rb', line 14 def call pt_client = TrackerApi::Client.new(token: token) @data = pt_client.project(project_id) rescue StandardError => e @errors << e. end |