Class: Hackmac::OC
- Inherits:
-
Object
- Object
- Hackmac::OC
- Defined in:
- lib/hackmac/oc.rb
Instance Method Summary collapse
-
#initialize(config:) ⇒ OC
constructor
A new instance of OC.
- #inspect ⇒ Object
- #name ⇒ Object
- #remote ⇒ Object
- #to_s ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(config:) ⇒ OC
Returns a new instance of OC.
3 4 5 |
# File 'lib/hackmac/oc.rb', line 3 def initialize(config:) @config = config end |
Instance Method Details
#inspect ⇒ Object
30 31 32 |
# File 'lib/hackmac/oc.rb', line 30 def inspect "#<#{self.class}: #{to_s}>" end |
#name ⇒ Object
22 23 24 |
# File 'lib/hackmac/oc.rb', line 22 def name remote.name end |
#remote ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/hackmac/oc.rb', line 7 def remote @remote and return @remote source = @config.oc.source github = source.github auth = [ @config.github.user, @config.github.access_token ].compact auth.empty? and auth = nil suffix = case debug = source.debug? when true then 'DEBUG' when false then 'RELEASE' when nil then nil end @remote = Hackmac::GithubSource.new(github, auth: auth, suffix: suffix) end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/hackmac/oc.rb', line 34 def to_s "#{name} #{version}" end |
#version ⇒ Object
26 27 28 |
# File 'lib/hackmac/oc.rb', line 26 def version remote.version end |