Class: Realm::Dependency
- Inherits:
-
Object
- Object
- Realm::Dependency
- Defined in:
- lib/realm/dependency.rb
Instance Attribute Summary collapse
-
#dependable ⇒ Object
readonly
Returns the value of attribute dependable.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(dependable, as: nil, optional: false, lazy: false) ⇒ Dependency
constructor
rubocop:disable Naming/MethodParameterName.
- #lazy? ⇒ Boolean
- #optional? ⇒ Boolean
Constructor Details
#initialize(dependable, as: nil, optional: false, lazy: false) ⇒ Dependency
rubocop:disable Naming/MethodParameterName
7 8 9 10 11 12 |
# File 'lib/realm/dependency.rb', line 7 def initialize(dependable, as: nil, optional: false, lazy: false) # rubocop:disable Naming/MethodParameterName @dependable = dependable @name = as || dependable.to_s.demodulize.underscore.to_sym @optional = optional @lazy = lazy end |
Instance Attribute Details
#dependable ⇒ Object (readonly)
Returns the value of attribute dependable.
5 6 7 |
# File 'lib/realm/dependency.rb', line 5 def dependable @dependable end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/realm/dependency.rb', line 5 def name @name end |
Instance Method Details
#lazy? ⇒ Boolean
18 19 20 |
# File 'lib/realm/dependency.rb', line 18 def lazy? @lazy end |
#optional? ⇒ Boolean
14 15 16 |
# File 'lib/realm/dependency.rb', line 14 def optional? @optional end |