Class: Zermelo::Records::Key
- Inherits:
-
Object
- Object
- Zermelo::Records::Key
- Defined in:
- lib/zermelo/records/key.rb
Instance Attribute Summary collapse
-
#accessor ⇒ Object
readonly
id / if nil, it’s a class variable object / :association, :attribute or :index accessor / if a complex type, some way of getting sub-value.
-
#id ⇒ Object
Returns the value of attribute id.
-
#klass ⇒ Object
readonly
id / if nil, it’s a class variable object / :association, :attribute or :index accessor / if a complex type, some way of getting sub-value.
-
#name ⇒ Object
readonly
id / if nil, it’s a class variable object / :association, :attribute or :index accessor / if a complex type, some way of getting sub-value.
-
#object ⇒ Object
readonly
id / if nil, it’s a class variable object / :association, :attribute or :index accessor / if a complex type, some way of getting sub-value.
-
#type ⇒ Object
readonly
id / if nil, it’s a class variable object / :association, :attribute or :index accessor / if a complex type, some way of getting sub-value.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Key
constructor
TODO better validation of data, e.g.
Constructor Details
#initialize(opts = {}) ⇒ Key
TODO better validation of data, e.g. accessor valid for type, etc.
14 15 16 17 18 |
# File 'lib/zermelo/records/key.rb', line 14 def initialize(opts = {}) [:klass, :id, :name, :accessor, :type, :object].each do |iv| instance_variable_set("@#{iv}", opts[iv]) end end |
Instance Attribute Details
#accessor ⇒ Object (readonly)
id / if nil, it’s a class variable object / :association, :attribute or :index accessor / if a complex type, some way of getting sub-value
9 10 11 |
# File 'lib/zermelo/records/key.rb', line 9 def accessor @accessor end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/zermelo/records/key.rb', line 11 def id @id end |
#klass ⇒ Object (readonly)
id / if nil, it’s a class variable object / :association, :attribute or :index accessor / if a complex type, some way of getting sub-value
9 10 11 |
# File 'lib/zermelo/records/key.rb', line 9 def klass @klass end |
#name ⇒ Object (readonly)
id / if nil, it’s a class variable object / :association, :attribute or :index accessor / if a complex type, some way of getting sub-value
9 10 11 |
# File 'lib/zermelo/records/key.rb', line 9 def name @name end |
#object ⇒ Object (readonly)
id / if nil, it’s a class variable object / :association, :attribute or :index accessor / if a complex type, some way of getting sub-value
9 10 11 |
# File 'lib/zermelo/records/key.rb', line 9 def object @object end |
#type ⇒ Object (readonly)
id / if nil, it’s a class variable object / :association, :attribute or :index accessor / if a complex type, some way of getting sub-value
9 10 11 |
# File 'lib/zermelo/records/key.rb', line 9 def type @type end |