Class: Smiling::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/smiling/tag.rb

Overview

Public: Tag represents a tag for video.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Tag

Public: Create an instance of Tag.

attributes - The hash options.

:value - The String value of tag.
:lock  - The Boolean value for lock state (optional).

Examples

Tag.new(value: 'Foo')
Tag.new(value: 'Foo', lock: true)


16
17
18
19
# File 'lib/smiling/tag.rb', line 16

def initialize(attributes)
  @value = attributes[:value] unless attributes[:value].nil?
  @lock = attributes[:lock].nil? ? false : attributes[:lock]
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/smiling/tag.rb', line 4

def value
  @value
end

Instance Method Details

#locked?Boolean

Public: Returns true when tag is locked.

Examples

tag = Tag.new(value: 'Foo', lock: true)
tag.locked?
# => true

Returns the Boolean value.

Returns:

  • (Boolean)


30
31
32
# File 'lib/smiling/tag.rb', line 30

def locked?
  @lock
end