Class: Yoda::Store::Objects::ProjectStatus::StdStatus

Inherits:
Object
  • Object
show all
Includes:
Serializable
Defined in:
lib/yoda/store/objects/project_status.rb

Overview

Remember ruby core and standard library state

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Serializable

#derive, included, #to_json

Constructor Details

#initialize(version:, core_present:, std_present:) ⇒ StdStatus

Returns a new instance of StdStatus.

Parameters:

  • version (String)
  • core_present (true, false)

    represents the flag if core’s index file is present.

  • std_present (true, false)

    represents the flag if standard library’s index file is present.



107
108
109
110
111
# File 'lib/yoda/store/objects/project_status.rb', line 107

def initialize(version:, core_present:, std_present:)
  @version = version
  @core_present = core_present
  @std_present = std_present
end

Instance Attribute Details

#core_presenttrue, false (readonly)

Returns:

  • (true, false)


97
98
99
# File 'lib/yoda/store/objects/project_status.rb', line 97

def core_present
  @core_present
end

#std_presenttrue, false (readonly)

Returns:

  • (true, false)


97
98
99
# File 'lib/yoda/store/objects/project_status.rb', line 97

def std_present
  @std_present
end

#versionString (readonly)

Returns:

  • (String)


94
95
96
# File 'lib/yoda/store/objects/project_status.rb', line 94

def version
  @version
end

Class Method Details

.initial_buildStdStatus

Returns:



100
101
102
# File 'lib/yoda/store/objects/project_status.rb', line 100

def self.initial_build
  new(version: RUBY_VERSION, core_present: false, std_present: false)
end

Instance Method Details

#all_present?true, false

Returns:

  • (true, false)


114
115
116
# File 'lib/yoda/store/objects/project_status.rb', line 114

def all_present?
  core_present? && std_present?
end

#core_present?true, false

Returns:

  • (true, false)


119
120
121
# File 'lib/yoda/store/objects/project_status.rb', line 119

def core_present?
  core_present
end

#std_present?true, false

Returns:

  • (true, false)


124
125
126
# File 'lib/yoda/store/objects/project_status.rb', line 124

def std_present?
  std_present
end

#to_hObject



128
129
130
# File 'lib/yoda/store/objects/project_status.rb', line 128

def to_h
  { version: version, core_present: core_present, std_present: std_present }
end