Class: BetterSeo::StructuredData::Organization

Inherits:
Base
  • Object
show all
Defined in:
lib/better_seo/structured_data/organization.rb

Instance Attribute Summary

Attributes inherited from Base

#properties, #type

Instance Method Summary collapse

Methods inherited from Base

#get, #set, #to_h, #to_json, #to_script_tag, #valid?, #validate!

Constructor Details

#initialize(**properties) ⇒ Organization

Returns a new instance of Organization.



6
7
8
# File 'lib/better_seo/structured_data/organization.rb', line 6

def initialize(**properties)
  super("Organization", **properties)
end

Instance Method Details

#address(value) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/better_seo/structured_data/organization.rb', line 34

def address(value)
  if value.is_a?(Hash)
    postal_address = {
      "@type" => "PostalAddress",
      "streetAddress" => value[:street],
      "addressLocality" => value[:city],
      "addressRegion" => value[:region],
      "postalCode" => value[:postal_code],
      "addressCountry" => value[:country]
    }.compact
    set(:address, postal_address)
  else
    set(:address, value)
  end
end

#description(value) ⇒ Object



22
23
24
# File 'lib/better_seo/structured_data/organization.rb', line 22

def description(value)
  set(:description, value)
end

#email(value) ⇒ Object



26
27
28
# File 'lib/better_seo/structured_data/organization.rb', line 26

def email(value)
  set(:email, value)
end

#founder(value) ⇒ Object



58
59
60
# File 'lib/better_seo/structured_data/organization.rb', line 58

def founder(value)
  set(:founder, value)
end

#founders(value) ⇒ Object



62
63
64
# File 'lib/better_seo/structured_data/organization.rb', line 62

def founders(value)
  set(:founder, value)
end

#founding_date(value) ⇒ Object



54
55
56
# File 'lib/better_seo/structured_data/organization.rb', line 54

def founding_date(value)
  set(:foundingDate, value)
end

#logo(value) ⇒ Object



18
19
20
# File 'lib/better_seo/structured_data/organization.rb', line 18

def (value)
  set(:logo, value)
end

#name(value) ⇒ Object



10
11
12
# File 'lib/better_seo/structured_data/organization.rb', line 10

def name(value)
  set(:name, value)
end

#same_as(value) ⇒ Object



50
51
52
# File 'lib/better_seo/structured_data/organization.rb', line 50

def same_as(value)
  set(:sameAs, value)
end

#telephone(value) ⇒ Object



30
31
32
# File 'lib/better_seo/structured_data/organization.rb', line 30

def telephone(value)
  set(:telephone, value)
end

#url(value) ⇒ Object



14
15
16
# File 'lib/better_seo/structured_data/organization.rb', line 14

def url(value)
  set(:url, value)
end