Class: HasOne
- Defined in:
- lib/mailroute/extensions/active_resource/has_one.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#model ⇒ Object
Returns the value of attribute model.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass
1 2 3 |
# File 'lib/mailroute/extensions/active_resource/has_one.rb', line 1 def klass @klass end |
#model ⇒ Object
Returns the value of attribute model
1 2 3 |
# File 'lib/mailroute/extensions/active_resource/has_one.rb', line 1 def model @model end |
#options ⇒ Object
Returns the value of attribute options
1 2 3 |
# File 'lib/mailroute/extensions/active_resource/has_one.rb', line 1 def @options end |
Instance Method Details
#foreign_class ⇒ Object
6 7 8 |
# File 'lib/mailroute/extensions/active_resource/has_one.rb', line 6 def foreign_class [:class] || Mailroute.const_get(ActiveSupport::Inflector.classify(model)) end |
#inverse ⇒ Object
2 3 4 |
# File 'lib/mailroute/extensions/active_resource/has_one.rb', line 2 def inverse ActiveSupport::Inflector.underscore(klass.to_s.split('::').last) end |
#pk ⇒ Object
10 11 12 |
# File 'lib/mailroute/extensions/active_resource/has_one.rb', line 10 def pk [:pk] end |