Class: Vault::Properties::Property
- Inherits:
-
Object
- Object
- Vault::Properties::Property
- Defined in:
- lib/vault/properties.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #default ⇒ Object
-
#eql?(other) ⇒ Boolean
:nodoc:.
-
#hash ⇒ Object
Set requires both #hash and #eql? to check for inclusion.
-
#initialize(name, primary = false, &default) ⇒ Property
constructor
A new instance of Property.
- #primary? ⇒ Boolean
Constructor Details
#initialize(name, primary = false, &default) ⇒ Property
Returns a new instance of Property.
44 45 46 47 48 |
# File 'lib/vault/properties.rb', line 44 def initialize(name, primary=false, &default) @name = name.to_s @default = default || lambda {} @primary = primary end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
42 43 44 |
# File 'lib/vault/properties.rb', line 42 def name @name end |
Instance Method Details
#default ⇒ Object
54 55 56 |
# File 'lib/vault/properties.rb', line 54 def default @default.call end |
#eql?(other) ⇒ Boolean
:nodoc:
63 64 65 |
# File 'lib/vault/properties.rb', line 63 def eql?(other) # :nodoc: name == other.name end |
#hash ⇒ Object
Set requires both #hash and #eql? to check for inclusion
59 60 61 |
# File 'lib/vault/properties.rb', line 59 def hash # :nodoc: name.hash end |
#primary? ⇒ Boolean
50 51 52 |
# File 'lib/vault/properties.rb', line 50 def primary? @primary end |