Class: Smiling::Tag
- Inherits:
-
Object
- Object
- Smiling::Tag
- Defined in:
- lib/smiling/tag.rb
Overview
Public: Tag represents a tag for video.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Tag
constructor
Public: Create an instance of Tag.
-
#locked? ⇒ Boolean
Public: Returns true when tag is locked.
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
#value ⇒ Object (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.
30 31 32 |
# File 'lib/smiling/tag.rb', line 30 def locked? @lock end |