Class: VinoChipperModel
- Inherits:
-
Object
show all
- Defined in:
- lib/models/vinochippermodel.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of VinoChipperModel.
4
5
6
|
# File 'lib/models/vinochippermodel.rb', line 4
def initialize(deets)
@deets = deets
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'lib/models/vinochippermodel.rb', line 12
def method_missing(*args)
message = args[0].to_s.camel_case_lower
if message.end_with?('=')
@deets[message.chomp!('=')] = args[1]
else
@deets[message] || super
end
end
|
Instance Method Details
#keys ⇒ Object
21
22
23
|
# File 'lib/models/vinochippermodel.rb', line 21
def keys
@deets.keys
end
|
#respond_to_missing?(method_name, _include_private = false) ⇒ Boolean
8
9
10
|
# File 'lib/models/vinochippermodel.rb', line 8
def respond_to_missing?(method_name, _include_private = false)
@deets.keys.include? method_name.to_s
end
|