Class: Dev::TargetProcess::Release
- Defined in:
- lib/firespring_dev_commands/target_process/release.rb
Overview
Class containing release information
Constant Summary collapse
- RESOURCE_TYPE =
The resource type for the api endpoint
'Release'.freeze
- PATH =
The api path for release requests
'/Releases'.freeze
Instance Attribute Summary collapse
-
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
-
#data ⇒ Object
Returns the value of attribute data.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data) ⇒ Release
constructor
A new instance of Release.
-
#parse_time(string) ⇒ Object
Parse the dot net time representation into something that ruby can use.
Constructor Details
#initialize(data) ⇒ Release
Returns a new instance of Release.
13 14 15 16 17 18 19 20 21 |
# File 'lib/firespring_dev_commands/target_process/release.rb', line 13 def initialize(data) @data = data @id = data['Id'] @type = data['ResourceType'] @name = data['Name'] @start_date = parse_time(data['StartDate']) @end_date = parse_time(data['EndDate']) @custom_fields = data['CustomFields'] end |
Instance Attribute Details
#custom_fields ⇒ Object
Returns the value of attribute custom_fields.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/release.rb', line 11 def custom_fields @custom_fields end |
#data ⇒ Object
Returns the value of attribute data.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/release.rb', line 11 def data @data end |
#end_date ⇒ Object
Returns the value of attribute end_date.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/release.rb', line 11 def end_date @end_date end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/release.rb', line 11 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/release.rb', line 11 def name @name end |
#start_date ⇒ Object
Returns the value of attribute start_date.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/release.rb', line 11 def start_date @start_date end |
#type ⇒ Object
Returns the value of attribute type.
11 12 13 |
# File 'lib/firespring_dev_commands/target_process/release.rb', line 11 def type @type end |
Instance Method Details
#parse_time(string) ⇒ Object
Parse the dot net time representation into something that ruby can use
24 25 26 27 28 |
# File 'lib/firespring_dev_commands/target_process/release.rb', line 24 def parse_time(string) return nil unless string && !string.empty? ::Time.at(string.slice(6, 10).to_i) end |