Class: Eh::Settings::Proxy
- Inherits:
-
Object
- Object
- Eh::Settings::Proxy
- Defined in:
- lib/eh/settings.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #default? ⇒ Boolean
-
#initialize(json) ⇒ Proxy
constructor
A new instance of Proxy.
- #label ⇒ Object
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
#default ⇒ Object (readonly)
Returns the value of attribute default.
37 38 39 |
# File 'lib/eh/settings.rb', line 37 def default @default end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
37 38 39 |
# File 'lib/eh/settings.rb', line 37 def name @name end |
#url ⇒ Object (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
39 40 41 |
# File 'lib/eh/settings.rb', line 39 def default? !!@default end |
#label ⇒ Object
43 44 45 46 47 |
# File 'lib/eh/settings.rb', line 43 def label label = "#{name} -> #{url}" label << " (default)" if default? label end |