Class: Dgrid::API::NamedEntity
- Defined in:
- lib/dgrid/api/named_entity.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Attributes inherited from Entity
#description, #id, #workspaces
Instance Method Summary collapse
-
#initialize(options) ⇒ NamedEntity
constructor
A new instance of NamedEntity.
- #to_hash ⇒ Object
Methods inherited from Entity
#add_entity, #add_workspace, #attach, #connection, #first_workspace, #in_workspace?, #link_to, #new_record?, pluralized, singular, #type, type
Methods included from SetMembersFromHash
#change_string_keys_to_symbol_keys, #set_members_from_hash, #split_hash
Methods included from Dgrid::ArgumentValidation
Constructor Details
#initialize(options) ⇒ NamedEntity
Returns a new instance of NamedEntity.
8 9 10 11 12 |
# File 'lib/dgrid/api/named_entity.rb', line 8 def initialize() parent_opts, my_opts = split_hash(,[:id, :description]) super(parent_opts) set_members_from_hash(my_opts) end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/dgrid/api/named_entity.rb', line 5 def name @name end |
Instance Method Details
#to_hash ⇒ Object
14 15 16 |
# File 'lib/dgrid/api/named_entity.rb', line 14 def to_hash { :name => name, :description => description } end |