Class: Fintoc::V2::Entity
- Inherits:
-
Object
- Object
- Fintoc::V2::Entity
- Defined in:
- lib/fintoc/v2/resources/entity.rb
Instance Attribute Summary collapse
-
#holder_id ⇒ Object
readonly
Returns the value of attribute holder_id.
-
#holder_name ⇒ Object
readonly
Returns the value of attribute holder_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_root ⇒ Object
readonly
Returns the value of attribute is_root.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
-
#initialize(object:, mode:, id:, holder_name:, holder_id:, is_root:, client: nil) ⇒ Entity
constructor
A new instance of Entity.
- #refresh ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(object:, mode:, id:, holder_name:, holder_id:, is_root:, client: nil) ⇒ Entity
Returns a new instance of Entity.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fintoc/v2/resources/entity.rb', line 6 def initialize( object:, mode:, id:, holder_name:, holder_id:, is_root:, client: nil, ** ) @object = object @mode = mode @id = id @holder_name = holder_name @holder_id = holder_id @is_root = is_root @client = client end |
Instance Attribute Details
#holder_id ⇒ Object (readonly)
Returns the value of attribute holder_id.
4 5 6 |
# File 'lib/fintoc/v2/resources/entity.rb', line 4 def holder_id @holder_id end |
#holder_name ⇒ Object (readonly)
Returns the value of attribute holder_name.
4 5 6 |
# File 'lib/fintoc/v2/resources/entity.rb', line 4 def holder_name @holder_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/fintoc/v2/resources/entity.rb', line 4 def id @id end |
#is_root ⇒ Object (readonly)
Returns the value of attribute is_root.
4 5 6 |
# File 'lib/fintoc/v2/resources/entity.rb', line 4 def is_root @is_root end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
4 5 6 |
# File 'lib/fintoc/v2/resources/entity.rb', line 4 def mode @mode end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
4 5 6 |
# File 'lib/fintoc/v2/resources/entity.rb', line 4 def object @object end |
Instance Method Details
#refresh ⇒ Object
29 30 31 32 |
# File 'lib/fintoc/v2/resources/entity.rb', line 29 def refresh fresh_entity = @client.entities.get(@id) refresh_from_entity(fresh_entity) end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/fintoc/v2/resources/entity.rb', line 25 def to_s "🏢 #{@holder_name} (#{@id})" end |