Class: Fastlane::Plugin::GitHubStatus::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/github_status/message.rb

Overview

Immutable module object representing the last status message provided by GitHub

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_hash) ⇒ Message

Expects to be called with a hash of the JSON data returned from the GitHub status API endpoint

status.github.com/api

'status' => 'good',
'body' => 'Everything operating normally.',
'created_on' => '2016-06-01T16:40:35Z'



30
31
32
33
34
# File 'lib/fastlane/plugin/github_status/message.rb', line 30

def initialize(data_hash)
  @status = data_hash['status']
  @body = data_hash['body']
  @created_on = Time.parse(data_hash['created_on'])
end

Instance Attribute Details

#bodyObject (readonly)

A more descriptive message describing the current situation



14
15
16
# File 'lib/fastlane/plugin/github_status/message.rb', line 14

def body
  @body
end

#created_onObject (readonly)

Time object representing when this status message was created by GitHub



18
19
20
# File 'lib/fastlane/plugin/github_status/message.rb', line 18

def created_on
  @created_on
end

#statusObject (readonly)

String representing one of three possible statuses:

  • ‘good’ - Everything is OK

  • ‘minor’ - GitHub is experiencing minor problems

  • ‘major’ - GitHub is experiencing major problems



11
12
13
# File 'lib/fastlane/plugin/github_status/message.rb', line 11

def status
  @status
end