Class: Bhf::Mongoid::Document::Field
- Inherits:
-
Object
- Object
- Bhf::Mongoid::Document::Field
- Defined in:
- lib/bhf/mongoid/document.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(mongoid_field) ⇒ Field
constructor
A new instance of Field.
Constructor Details
#initialize(mongoid_field) ⇒ Field
Returns a new instance of Field.
9 10 11 12 13 |
# File 'lib/bhf/mongoid/document.rb', line 9 def initialize(mongoid_field) @name = mongoid_field.name @type = mongoid_field.type.to_s.downcase.gsub('mongoid::', '').to_sym @type = :primary_key if @type == :'bson::objectid' end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/bhf/mongoid/document.rb', line 7 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
7 8 9 |
# File 'lib/bhf/mongoid/document.rb', line 7 def type @type end |