Class: BaseFile
- Inherits:
-
Object
- Object
- BaseFile
- Defined in:
- lib/dynalist/base_file.rb
Constant Summary collapse
- PERMISSION =
{ 0 => :no_access, 1 => :read_only, 2 => :edit_rights, 3 => :manage, 4 => :owner }
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #include(**query) ⇒ Object
-
#initialize(id: nil, title: nil, type: nil, permission: nil) ⇒ BaseFile
constructor
A new instance of BaseFile.
- #permission ⇒ Object
Constructor Details
#initialize(id: nil, title: nil, type: nil, permission: nil) ⇒ BaseFile
Returns a new instance of BaseFile.
14 15 16 17 18 19 |
# File 'lib/dynalist/base_file.rb', line 14 def initialize(id: nil, title: nil, type: nil, permission: nil) @id = id @title = title @type = type @permission_number = end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/dynalist/base_file.rb', line 12 def id @id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
12 13 14 |
# File 'lib/dynalist/base_file.rb', line 12 def title @title end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
12 13 14 |
# File 'lib/dynalist/base_file.rb', line 12 def type @type end |
Instance Method Details
#include(**query) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/dynalist/base_file.rb', line 25 def include(**query) query.each do |key, value| next if instance_variable_get("@#{key}") == value return false end return true end |
#permission ⇒ Object
21 22 23 |
# File 'lib/dynalist/base_file.rb', line 21 def PERMISSION[@permission_number] end |