Class: OpConnect::Item
- Inherits:
-
Object
- Object
- OpConnect::Item
- Defined in:
- lib/op_connect/item.rb,
lib/op_connect/item/url.rb,
lib/op_connect/item/file.rb,
lib/op_connect/item/field.rb,
lib/op_connect/item/section.rb,
lib/op_connect/item/generator_recipe.rb
Defined Under Namespace
Classes: Field, File, GeneratorRecipe, Section, URL
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_favorite ⇒ Object
(also: #favorite?)
readonly
Returns the value of attribute is_favorite.
-
#last_edited_by ⇒ Object
readonly
Returns the value of attribute last_edited_by.
-
#sections ⇒ Object
readonly
Returns the value of attribute sections.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#urls ⇒ Object
readonly
Returns the value of attribute urls.
-
#vault ⇒ Object
readonly
Returns the value of attribute vault.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(options = {}) ⇒ Item
Returns a new instance of Item.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/op_connect/item.rb', line 13 def initialize( = {}) @id = ["id"] @title = ["title"] @vault = Object.new(["vault"]) @category = ["category"] @urls = ["urls"]&.collect! { |url| URL.new(url) } @is_favorite = ["favorite"] || false @tags = ["tags"] @version = ["version"] @state = ["state"] @sections = ["sections"]&.collect! { |section| Section.new(section) } || [] @fields = ["fields"]&.collect! { |field| Field.new(field) } || [] @files = ["files"]&.collect! { |file| File.new(file) } || [] @created_at = ["createdAt"] @updated_at = ["updatedAt"] @last_edited_by = ["lastEditedBy"] end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def category @category end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def created_at @created_at end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def fields @fields end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def files @files end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def id @id end |
#is_favorite ⇒ Object (readonly) Also known as: favorite?
Returns the value of attribute is_favorite.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def is_favorite @is_favorite end |
#last_edited_by ⇒ Object (readonly)
Returns the value of attribute last_edited_by.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def last_edited_by @last_edited_by end |
#sections ⇒ Object (readonly)
Returns the value of attribute sections.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def sections @sections end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def state @state end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def @tags end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def title @title end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def updated_at @updated_at end |
#urls ⇒ Object (readonly)
Returns the value of attribute urls.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def urls @urls end |
#vault ⇒ Object (readonly)
Returns the value of attribute vault.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def vault @vault end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
9 10 11 |
# File 'lib/op_connect/item.rb', line 9 def version @version end |