Class: Eh::Settings::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/eh/settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ Proxy

Returns a new instance of Proxy.



32
33
34
35
36
# File 'lib/eh/settings.rb', line 32

def initialize(json)
  @name = json['name']
  @default = json['default']
  @url = json['url']
end

Instance Attribute Details

#defaultObject (readonly)

Returns the value of attribute default.



37
38
39
# File 'lib/eh/settings.rb', line 37

def default
  @default
end

#nameObject (readonly)

Returns the value of attribute name.



37
38
39
# File 'lib/eh/settings.rb', line 37

def name
  @name
end

#urlObject (readonly)

Returns the value of attribute url.



37
38
39
# File 'lib/eh/settings.rb', line 37

def url
  @url
end

Instance Method Details

#default?Boolean

Returns:

  • (Boolean)


39
40
41
# File 'lib/eh/settings.rb', line 39

def default?
  !!@default
end

#labelObject



43
44
45
46
47
# File 'lib/eh/settings.rb', line 43

def label
  label = "#{name} -> #{url}"
  label << " (default)" if default?
  label
end