Class: Bio::BaseSpace::BaseSpaceModel
- Defined in:
- lib/basespace/model/basespace_model.rb
Overview
Basic representation of a BaseSpace model.
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
Attributes inherited from Model
Instance Method Summary collapse
-
#id ⇒ Object
Returns the ID of the model.
-
#initialize ⇒ BaseSpaceModel
constructor
Create a new BaseSpaceModel instance.
-
#is_init ⇒ Object
Returns whether this object has been initialized, which is always the case (i.e., true).
-
#set_api(api) ⇒ Object
Set a BaseSpaceAPI object for this BaseSpaceModel.
-
#to_s ⇒ Object
Returns the ID of the model.
Methods inherited from Model
#get_attr, #method_missing, #set_attr, #to_str
Constructor Details
#initialize ⇒ BaseSpaceModel
Create a new BaseSpaceModel instance.
24 25 26 27 28 29 30 31 32 |
# File 'lib/basespace/model/basespace_model.rb', line 24 def initialize # [TODO] This class is not similar to other modles. Need to check if this port is OK. @swagger_types = { 'Id' => 'str', } @attributes = { 'Id' => nil, } end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Bio::BaseSpace::Model
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
21 22 23 |
# File 'lib/basespace/model/basespace_model.rb', line 21 def api @api end |
Instance Method Details
#id ⇒ Object
Returns the ID of the model.
35 36 37 |
# File 'lib/basespace/model/basespace_model.rb', line 35 def id get_attr('Id') end |
#is_init ⇒ Object
Returns whether this object has been initialized, which is always the case (i.e., true).
46 47 48 |
# File 'lib/basespace/model/basespace_model.rb', line 46 def is_init return true end |
#set_api(api) ⇒ Object
Set a BaseSpaceAPI object for this BaseSpaceModel.
api
-
BaseSpaceAPI instance.
53 54 55 |
# File 'lib/basespace/model/basespace_model.rb', line 53 def set_api(api) @api = api end |
#to_s ⇒ Object
Returns the ID of the model.
40 41 42 43 |
# File 'lib/basespace/model/basespace_model.rb', line 40 def to_s is_init return get_attr('Id') end |