Module: CrvApiClient::Helpers::Attributes
- Defined in:
- lib/crv_api_client/helpers/attributes.rb
Instance Method Summary collapse
-
#attr_accessor_with_type(name, type) ⇒ Object
defines an public attribute writer and reader.
-
#attr_reader_with_type(name, type) ⇒ Object
defines an public attribute reader and a private writer name: the instance variable name for which a get method has to be created type: The object type.
Instance Method Details
#attr_accessor_with_type(name, type) ⇒ Object
defines an public attribute writer and reader. name: the instance variable name for which a get method has to be created type: The object type.
16 17 18 |
# File 'lib/crv_api_client/helpers/attributes.rb', line 16 def attr_accessor_with_type(name, type) define_attribute_methods(name, type) end |
#attr_reader_with_type(name, type) ⇒ Object
defines an public attribute reader and a private writer name: the instance variable name for which a get method has to be created type: The object type.
8 9 10 11 |
# File 'lib/crv_api_client/helpers/attributes.rb', line 8 def attr_reader_with_type(name, type) define_attribute_methods(name, type) class_eval { private "#{name}=" } end |