Class: Sirens::MethodModel
- Inherits:
-
Object
- Object
- Sirens::MethodModel
- Defined in:
- lib/sirens/models/method_model.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#source_code ⇒ Object
readonly
Returns the value of attribute source_code.
Instance Method Summary collapse
-
#initialize ⇒ MethodModel
constructor
Initializing.
- #set_method(method) ⇒ Object
Constructor Details
#initialize ⇒ MethodModel
Initializing
8 9 10 11 12 13 14 |
# File 'lib/sirens/models/method_model.rb', line 8 def initialize() super() @method = ValueModel.new @location = ValueModel.new @source_code = ValueModel.new end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
16 17 18 |
# File 'lib/sirens/models/method_model.rb', line 16 def location @location end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
16 17 18 |
# File 'lib/sirens/models/method_model.rb', line 16 def method @method end |
#source_code ⇒ Object (readonly)
Returns the value of attribute source_code.
16 17 18 |
# File 'lib/sirens/models/method_model.rb', line 16 def source_code @source_code end |
Instance Method Details
#set_method(method) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/sirens/models/method_model.rb', line 20 def set_method(method) if method.nil? @method.set_value(nil) @location.set_value(nil) @source_code.set_value(nil) return end @method.set_value(method) @location.set_value(method.source_location) @source_code.set_value(method.source_code) end |