Class: Dish::Shot
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id) ⇒ Shot
constructor
A new instance of Shot.
- #method_missing(name, *args, &block) ⇒ Object
- #profile(force = false) ⇒ Object
Constructor Details
#initialize(id) ⇒ Shot
Returns a new instance of Shot.
8 9 10 |
# File 'lib/dish/shot.rb', line 8 def initialize(id) self.id = id end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
16 17 18 |
# File 'lib/dish/shot.rb', line 16 def method_missing(name, *args, &block) profile.has_key?(id.to_s) ? profile[id.to_s] : super end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/dish/shot.rb', line 4 def id @id end |
Instance Method Details
#profile(force = false) ⇒ Object
12 13 14 |
# File 'lib/dish/shot.rb', line 12 def profile(force = false) force ? @profile = get_profile : @profile ||= get_profile end |