Class: Hypermicrodata::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/hypermicrodata/property.rb

Direct Known Subclasses

Link, SubmitButton

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, names, rels = []) ⇒ Property

Returns a new instance of Property.



5
6
7
8
9
# File 'lib/hypermicrodata/property.rb', line 5

def initialize(value, names, rels = [])
  @value = value
  @names = names
  @rels = rels
end

Instance Attribute Details

#namesObject (readonly)

Returns the value of attribute names.



3
4
5
# File 'lib/hypermicrodata/property.rb', line 3

def names
  @names
end

#relsObject (readonly)

Returns the value of attribute rels.



3
4
5
# File 'lib/hypermicrodata/property.rb', line 3

def rels
  @rels
end

#valueObject (readonly)

Returns the value of attribute value.



3
4
5
# File 'lib/hypermicrodata/property.rb', line 3

def value
  @value
end

Instance Method Details

#itemObject



11
12
13
# File 'lib/hypermicrodata/property.rb', line 11

def item
  @value if @value.is_a?(Item)
end

#item?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/hypermicrodata/property.rb', line 15

def item?
  !!item
end

#link?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/hypermicrodata/property.rb', line 19

def link?
  false
end

#submit_button?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/hypermicrodata/property.rb', line 23

def submit_button?
  false
end