class RubyFly::RC::Target

Attributes

api[RW]
name[R]
team[RW]
token[RW]

Public Class Methods

clone(target, overrides = {}) click to toggle source
# File lib/ruby_fly/rc.rb, line 61
def self.clone(target, overrides = {})
  if target.nil?
    return target
  end
  Target.new(
      name: overrides[:name] || target.name,
      api: overrides[:api] || target.api,
      team: overrides[:team] || target.team,
      token: overrides[:token] || target.token)
end
new(parameters) click to toggle source
# File lib/ruby_fly/rc.rb, line 72
def initialize(parameters)
  @name = parameters[:name]
  @api = parameters[:api]
  @team = parameters[:team]
  @token = parameters[:token]
end

Public Instance Methods

==(other) click to toggle source
# File lib/ruby_fly/rc.rb, line 102
def ==(other)
  other.class == self.class && other.state == state
end
bearer_token() click to toggle source
# File lib/ruby_fly/rc.rb, line 86
def bearer_token
  @token[:type] == 'bearer' ?
      @token[:value] :
      nil
end
bearer_token=(value) click to toggle source
# File lib/ruby_fly/rc.rb, line 79
def bearer_token=(value)
  @token = {
      type: 'bearer',
      value: value
  }
end
encode_with(coder) click to toggle source
# File lib/ruby_fly/rc.rb, line 92
def encode_with(coder)
  coder.represent_map(
      nil,
      RubyFly::RC::Conversions.stringify_keys({
          api: @api,
          team: @team.to_s,
          token: @token
      }))
end
eql?(other) click to toggle source
# File lib/ruby_fly/rc.rb, line 106
def eql?(other)
  self == other
end
hash() click to toggle source
# File lib/ruby_fly/rc.rb, line 110
def hash
  state.hash
end

Protected Instance Methods

state() click to toggle source
# File lib/ruby_fly/rc.rb, line 116
def state
  [@name, @api, @team, @token]
end