Class: MyTimeline::UserStub
- Inherits:
-
Object
- Object
- MyTimeline::UserStub
- Extended by:
- ActiveModel::Naming
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations, Singleton
- Defined in:
- lib/my_timeline/user_stub.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.method_missing(meth, *args, &blk) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/my_timeline/user_stub.rb', line 31 def self.method_missing(meth, *args, &blk) if meth.to_s =~ /^find_by/ UserStub else instance.send meth, *args, &blk # super end end |
.settings_attr_accessor(*args) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/my_timeline/user_stub.rb', line 40 def self.settings_attr_accessor(*args) args.each do |method_name| eval " def self.#{method_name.to_s} RailsSettings::SettingObject.find_by_var(:core).send('#{method_name}') end def self.#{method_name.to_s}=(value) RailsSettings::SettingObject.find_by_var(:core).send('#{method_name}=', value) end " end end |
Instance Method Details
#events ⇒ Object
11 12 13 |
# File 'lib/my_timeline/user_stub.rb', line 11 def events Event end |
#id ⇒ Object
19 20 21 |
# File 'lib/my_timeline/user_stub.rb', line 19 def id nil end |
#persisted? ⇒ Boolean
27 28 29 |
# File 'lib/my_timeline/user_stub.rb', line 27 def persisted? false end |
#save! ⇒ Object
23 24 25 |
# File 'lib/my_timeline/user_stub.rb', line 23 def save! true end |
#settings(var = :core) ⇒ Object
15 16 17 |
# File 'lib/my_timeline/user_stub.rb', line 15 def settings(var = :core) RailsSettings::SettingObject.find_by_var var end |